struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Billy Ng" <kwo...@earthlink.net>
Subject Re: Forward to a servlet
Date Mon, 16 Dec 2002 07:59:49 GMT
So, should I do this?


web.xml
=====
   <servlet>
    <servlet-name>
        AccountHTML_jsp
    </servlet-name>
    <servlet-class>
        com.mydomain.AccountHTML_jsp
    </servlet-class>
   </servlet>
   <servlet-mapping>
    <servlet-name>
       AccountHTML_jsp
    </servlet-name>
    <url-pattern>
       /AccountHTML.jsp
    </url-pattern>
   </servlet-mapping>



struts-config.xml
===========
  <action path="/accounts"
   type="com.mydomain.AccountsAction"
   name="accountsForm"
   validate="false"
   input="/WEB-INF/jsp/AccountsHTML.jsp">
   <forward name="accounts" path="/WEB-INF/jsp/AccountsHTML.jsp"/>
  </action>


Billy Ng

----- Original Message -----
From: "David M. Karr" <dmkarr@earthlink.net>
To: <struts-user@jakarta.apache.org>
Sent: Sunday, December 15, 2002 11:25 PM
Subject: Re: Forward to a servlet


> >>>>> "Billy" == Billy Ng <kwokng@earthlink.net> writes:
>
>     Billy> Hi folks,
>     Billy> In my Struts app, I am using the Action to call the jsp file.
In the struts-config.xml, the action tag looks like this,
>
>     Billy>   <action path="/accounts"
>     Billy>    type="com.mydomain.AccountsAction"
>     Billy>    name="accountsForm"
>     Billy>    validate="false"
>     Billy>    input="/WEB-INF/jsp/AccountsHTML.jsp">
>     Billy>    <forward name="accounts"
path="/WEB-INF/jsp/AccountsHTML.jsp"/>
>     Billy>   </action>
>     Billy> Because of some deployment issue, I need to pre-compile the jsp
files.  I successfully use the ANT's jspc tag to compile the all the jsp
files to java files, then compile them to java files.  However, I cannot
make it use the servlet in the forward tag.  I tried to do this
(AccountsHTML_jsp is class file of the compiled version of
AccountsHTML.jsp), but I get 404 page.
>     Billy>   <action path="/accounts"
>     Billy>    type="com.mydomain.AccountsAction"
>     Billy>    name="accountsForm"
>     Billy>    validate="false"
>     Billy>    input="/WEB-INF/jsp/AccountsHTML.jsp">
>     Billy>    <forward name="accounts"
path="/WEB-INF/ui/AccountsHTML_jsp"/>
>     Billy>   </action>
>
>     Billy> Would anybody knows how can I make this work?
>
> You don't change your "struts-config.xml" at all to use precompiled JSP
pages.
> You do have to change your "web.xml" file, however, to include the servlet
> mappings for the generated servlets.  You also have to include the
generated
> and compiled servlet class files in your WAR file.
>
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net   ; SCJP
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message