Results 1 to 2 of 2
  1. #1
    albgist is offline Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Default Precompiling JSP pages

    Hello, sorry for my English.
    I’m trying to precompile JSP files with ANT script.
    With this I generated servlets from JSP:
    Java Code:
    <target name="jspc">
    
    	<taskdef classname="org.apache.jasper.JspC" name="jasper2">
    		<classpath id="jspc.classpath">
    			<pathelement location="C:\j2sdk1.4.2_12\lib\org.apache.jasper.jar" />
    			<path refid="jbossweb.classpath"/>
    		</classpath>
    	</taskdef>
    
    	<jasper2 validateXml="false" uriroot="${webapp.path}" package="org.fista.zg.ui.struts.pages" webXmlFragment="c:/generated_web.xml" outputDir="${webapp.path}/WEB-INF/src" />
    </target>
    So, now I have Servlet classes, and I want compile these classes. Some classes have been compiled successfully, but some not, many of unsuccessfully compiled pages thrown same error, for example:
    Java Code:
    [javac] C:\Documents and Settings\Administrator\workspace\web-admin\WebContent\WEB-INF\src\agencyDelete_jsp.java:79: cannot resolve symbol
        [javac] symbol  : variable actionForm 
        [javac] location: class org.fista.zg.ui.struts.pages.agencyDelete_jsp
        [javac] 		new Object[] {((AgencyInputForm)((DefaultInputActionForm)actionForm).getFormBean()).getContractNr()});
        [javac]                                                                          ^
    In JSP agencyDelete.jsp:
    Java Code:
    <bean:define id="actionForm" name="AgencyForm" />
    <%
    String message = WebCtrlFactory.getCtrl(request).getLocalizationString("org.fista.zg.ui.struts.agency.remove",
    new Object[] {((AgencyInputForm)((DefaultInputActionForm)actionForm).getFormBean()).getContractNr()});
    %>
    Ant compiling script:
    Java Code:
    <javac destdir="${webapp.path}/WEB-INF/classes" optimize="off" debug="on"
    			failonerror="false" srcdir="${webapp.path}/WEB-INF/src" excludes="**/*.smap" classpath="C:\Documents and Settings\Administrator\workspace\web-admin\build\classes">
    	<classpath>
    		<fileset dir="${webapp.path}/WEB-INF/lib">
    		      <include name="*.jar" />
    		</fileset>
    		<path refid="jbossweb.classpath"/>
    	</classpath>
    	<include name="**" />
    	<exclude name="tags/**" />
    	<exclude name="tiles/**" />
    </javac>
    So, please help me find the problem. I think problem is in:
    Java Code:
    <bean:define id="actionForm" name="AgencyForm" />
    Why compiler can't see this bean?

    Thank you!
    Last edited by albgist; 06-10-2013 at 04:19 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Precompiling JSP pages

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. differentiate user pages and admin pages in struts
    By phaniyelugula in forum Struts
    Replies: 3
    Last Post: 10-19-2012, 06:51 PM
  2. JSP pages
    By dalu in forum New To Java
    Replies: 6
    Last Post: 04-29-2011, 02:20 PM
  3. Image from pages
    By shakeel in forum Java 2D
    Replies: 1
    Last Post: 03-01-2011, 06:30 PM
  4. how to use Multiple GUI pages
    By jonwymore in forum SWT / JFace
    Replies: 3
    Last Post: 12-06-2010, 12:13 PM
  5. Getting all the pages from a domain
    By eva in forum New To Java
    Replies: 0
    Last Post: 12-25-2007, 12:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •