serverside foward from servlet

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

serverside foward from servlet

Chaminda
Hi Falks,
 
Can somebody help me to do a server side forward from servlet to a jsp/xhtml.
 
When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.
 
Please help me,

--
Chaminda Amarasinghe,


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: serverside foward from servlet

Gerrit Germis-2

Hi chaminda,

 

You need to add <dispatcher> tags to the <filter-mapping> tags in your web.xml to make dispatchers also use the filters:

 

<filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/xforms-jsp/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

  <filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/ops/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

 

Note that you need servlets 2.4 for this:

 

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"

         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

            http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

         version="2.4">

 

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto:[hidden email]]
Sent: Wednesday, November 21, 2007 2:46 AM
To: [hidden email]
Subject: [ops-users] serverside foward from servlet

 

Hi Falks,

 

Can somebody help me to do a server side forward from servlet to a jsp/xhtml.

 

When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.

 

Please help me,

--
Chaminda Amarasinghe,



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: serverside foward from servlet

Chaminda
Thanks lot Gerrit,
 
Many Thanks for the replly, Il try..

 
On 11/21/07, Gerrit Germis <[hidden email]> wrote:

Hi chaminda,

 

You need to add <dispatcher> tags to the <filter-mapping> tags in your web.xml to make dispatchers also use the filters:

 

<filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/xforms-jsp/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

  <filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/ops/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

 

Note that you need servlets 2.4 for this:

 

<web-app xmlns="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee"

         xmlns:xsi="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"> http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee

            <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" target="_blank"> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

         version="2.4">

 

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto: [hidden email]]
Sent: Wednesday, November 21, 2007 2:46 AM
To: [hidden email]
Subject: [ops-users] serverside foward from servlet

 

Hi Falks,

 

Can somebody help me to do a server side forward from servlet to a jsp/xhtml.

 

When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.

 

Please help me,

--
Chaminda Amarasinghe,



--
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
OW2 mailing lists service home page: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank"> http://www.ow2.org/wws




--
Chaminda Amarasinghe,

--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: serverside foward from servlet

Chaminda
Hi Gerrit,
 
Still the i couldnt find success :(
 
Can you check my code. Only 2 servlets 2 jsps... I have attached complete war and context config file for your easyness.. Just cheange the docBase in my-app.xml as required.
 
 
Thanks for your help,
Chami

 
On 11/21/07, Chaminda Amarasinghe <[hidden email]> wrote:
Thanks lot Gerrit,
 
Many Thanks for the replly, Il try..

 
On 11/21/07, Gerrit Germis <[hidden email]> wrote:

Hi chaminda,

 

You need to add <dispatcher> tags to the <filter-mapping> tags in your web.xml to make dispatchers also use the filters:

 

<filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/xforms-jsp/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

  <filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/ops/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

 

Note that you need servlets 2.4 for this:

 

<web-app xmlns="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee"

         xmlns:xsi="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"> http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee

            <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" target="_blank"> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

         version="2.4">

 

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto: [hidden email]]
Sent: Wednesday, November 21, 2007 2:46 AM
To: [hidden email]
Subject: [ops-users] serverside foward from servlet

 

Hi Falks,

 

Can somebody help me to do a server side forward from servlet to a jsp/xhtml.

 

When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.

 

Please help me,

--
Chaminda Amarasinghe,



--
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
OW2 mailing lists service home page: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank">http://www.ow2.org/wws




--
Chaminda Amarasinghe,



--
Chaminda Amarasinghe,

--
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
OW2 mailing lists service home page: http://www.ow2.org/wws

my-app.war (21K) Download Attachment
my-app.xml (146 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: serverside foward from servlet

Gerrit Germis-2
In reply to this post by Chaminda

Hi Chaminda,

 

Attached, you can find a sample .war I threw together.. there’s only 1 servlet (someAction.do) which forwards to /xforms-jsp/index.xhtml to process a form with ops. Note that my ops is deployed at ‘/ops’, not ‘/ops-nightly’, so be sure to change that in the web.xml

 

To test, simply navigate to: http://localhost:8080/my-app/someAction.do , it should show the Xform. (the reason I say “should” is that ops sometimes throws a fit for some reason and shows an error page, but refreshing and clearing the cache helps when that happens. Haven’t checked yet why it does that, so if you find out, by all means, please do share ;))

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto:[hidden email]]
Sent: Wednesday, November 21, 2007 11:11 AM
To: [hidden email]
Subject: Re: [ops-users] serverside foward from servlet

 

Hi Gerrit,

 

Still the i couldnt find success :(

 

Can you check my code. Only 2 servlets 2 jsps... I have attached complete war and context config file for your easyness.. Just cheange the docBase in my-app.xml as required.

 

 

Thanks for your help,

Chami

 

On 11/21/07, Chaminda Amarasinghe <[hidden email]> wrote:

Thanks lot Gerrit,

 

Many Thanks for the replly, Il try..

 

On 11/21/07, Gerrit Germis <[hidden email]> wrote:

Hi chaminda,

 

You need to add <dispatcher> tags to the <filter-mapping> tags in your web.xml to make dispatchers also use the filters:

 

<filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/xforms-jsp/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

  <filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/ops/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

 

Note that you need servlets 2.4 for this:

 

<web-app xmlns=" http://java.sun.com/xml/ns/j2ee"

         xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation=" http://java.sun.com/xml/ns/j2ee

            http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

         version="2.4">

 

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto: [hidden email]]
Sent: Wednesday, November 21, 2007 2:46 AM
To: [hidden email]
Subject: [ops-users] serverside foward from servlet

 

Hi Falks,

 

Can somebody help me to do a server side forward from servlet to a jsp/xhtml.

 

When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.

 

Please help me,

--
Chaminda Amarasinghe,




--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Chaminda Amarasinghe,




--
Chaminda Amarasinghe,



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws

my-app.war (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: serverside foward from servlet

Chaminda
Hi Gerrit,
 
Thanks lot for you kind help,
 
 
I'l try and let you know.

 
On 11/22/07, Gerrit Germis <[hidden email]> wrote:

Hi Chaminda,

 

Attached, you can find a sample .war I threw together.. there's only 1 servlet (someAction.do) which forwards to /xforms-jsp/index.xhtml to process a form with ops. Note that my ops is deployed at '/ops', not '/ops-nightly', so be sure to change that in the web.xml

 

To test, simply navigate to: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://localhost:8080/my-app/someAction.do" target="_blank"> http://localhost:8080/my-app/someAction.do , it should show the Xform. (the reason I say "should" is that ops sometimes throws a fit for some reason and shows an error page, but refreshing and clearing the cache helps when that happens. Haven't checked yet why it does that, so if you find out, by all means, please do share ;))

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto: [hidden email]]
Sent: Wednesday, November 21, 2007 11:11 AM
To: [hidden email]
Subject: Re: [ops-users] serverside foward from servlet

 

Hi Gerrit,

 

Still the i couldnt find success :(

 

Can you check my code. Only 2 servlets 2 jsps... I have attached complete war and context config file for your easyness.. Just cheange the docBase in my-app.xml as required.

 

 

Thanks for your help,

Chami

 

On 11/21/07, Chaminda Amarasinghe <[hidden email]> wrote:

Thanks lot Gerrit,

 

Many Thanks for the replly, Il try..

 

On 11/21/07, Gerrit Germis <[hidden email]> wrote:

Hi chaminda,

 

You need to add <dispatcher> tags to the <filter-mapping> tags in your web.xml to make dispatchers also use the filters:

 

<filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/xforms-jsp/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

  <filter-mapping>

    <filter-name>ops-xforms-filter</filter-name>

    <url-pattern>/ops/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

 

 

Note that you need servlets 2.4 for this:

 

<web-app xmlns="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee"

         xmlns:xsi="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"> http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee" target="_blank"> http://java.sun.com/xml/ns/j2ee

            <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" target="_blank"> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

         version="2.4">

 

 

Hope this helps,

Gerrit

 

 


From: Chaminda Amarasinghe [mailto: [hidden email]]
Sent: Wednesday, November 21, 2007 2:46 AM
To: [hidden email]
Subject: [ops-users] serverside foward from servlet

 

Hi Falks,

 

Can somebody help me to do a server side forward from servlet to a jsp/xhtml.

 

When I do req.getRequestDispatcher(/xforms-jsp/my.jsp).forward(req,res); the xfroms elemets not rendered.

 

Please help me,

--
Chaminda Amarasinghe,




--
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
OW2 mailing lists service home page: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank"> http://www.ow2.org/wws




--
Chaminda Amarasinghe,




--
Chaminda Amarasinghe,



--
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
OW2 mailing lists service home page: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank"> http://www.ow2.org/wws





--
Chaminda Amarasinghe,

--
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
OW2 mailing lists service home page: http://www.ow2.org/wws