Call a JSP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Call a JSP

brock.parker
Hello,

First of all, sorry for the previous blank message...

I would like to be able to call a JSP inside my application.  I have a jsp in my resources folder along the page-flow.xml.  I have the following entry in my page-flow.xml file:

<page id="helloWorld" path-info="/hello.jsp" />

<page path-info="/hello">  
        <action>  
                <result page="helloWorld" instance-passing="redirect" />  
        </action>  
</page>  

Whenever I try to access the URL http://localhost:8080/myApp/hello I get a Http 404 error from JBoss.

Is there something I need to add in my web.xml to be able to handle jsps?

Thanks,

Brock Parker



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Call a JSP

Erik Bruchez
Administrator
Brock,

First, OPS itself does not understand JSP files directly. So this:

   <page id="helloWorld" path-info="/hello.jsp" />

will not do anything useful at all.

Second, this is what the Java Servlet spec say:

   "If the container has an internal JSP container, the *.jsp extension
    is mapped to it, allowing JSP pages to be executed on demand. This
    mapping is termed an implicit mapping."

So if your JSP page is present in your WAR, and you try to access it
through something like:

   http://localhost:8080/myApp/hello.jsp

the JSP should get executed.

Finally, you could use the OPS Servlet Include Generator to include
the result of the execution of a JSP file in your
application. However, you may not have to do this if you are happy to
have a .jsp extension in your external URLs, or if you have something
like an Apache front-end which can rewrite external URLs without a
.jsp extension to an internal URL with a .jsp extension so that the
Servlet container is happy.

-Erik

[hidden email] wrote:
 > Hello,
 >
 > First of all, sorry for the previous blank message...
 >
 > I would like to be able to call a JSP inside my application.  I have
 > a jsp in my resources folder along the page-flow.xml.  I have the
 > following entry in my page-flow.xml file:
 >
 > <page id="helloWorld" path-info="/hello.jsp" />
 >
 > <page path-info="/hello">
 > <action>
 > <result page="helloWorld" instance-passing="redirect" />
 > </action>
 > </page>
 >
 > Whenever I try to access the URL http://localhost:8080/myApp/hello I
 > get a Http 404 error from JBoss.
 >
 > Is there something I need to add in my web.xml to be able to handle jsps?
 >
 > Thanks,
 >
 > Brock Parker



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws