• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

changing the context

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a action say Action1 with context context1

http://localhost:9080/ApplicationContext/context1/Action1.do

i want to fw this action to Action2.do such that
http://localhost:9080/ApplicationContext/context2/Action2.do

I am writing

<forward name="success" path="context2/Action2.do"></forward>

Even though request is getting forwarded to required action, my window URL still shows
http://localhost:9080/ApplicationContext/context1/Action1.do

1. Hence when I see new page and I try to submit other actions from that page they are still considered as inside context1

can anybody elabodate on context chaging
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
According to Action forward, what ever be the context it forwards to corresponding url / uri. so better check with code itself or use forwardaction just for this for forwrding to context2.

-eswar
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can u try this

<forward name="success" path="context2/Action2.do" redirect="true" />
 
Gajanan Kulkarni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..But my problem is not fully solved.

From Action1 when I am forwarding to action2 , redirect=true doesnt work.
in action2 , while forwarding it to Action2.Jsp when I say redirect= true
my Browser URL changes to
http://localhost:9080/ApplicationContext/Context2/Action2.jsp


However while jsp rendering , it gives error because in JSP I have written it like
<html:form action="action2.do" >

It shows error saying Cannot retrieve mapping for action /Cannot retrieve mapping for action/action2

in form I have tried following things
action="action2.do"
action="context2/action2.do"
action="/action2.do"
action="../context2/action2.do"

none of them works

in my web.xml for context1 & 2 I am referring same struts-config-<moodulename>.xml

Any comments?

Txs in advance
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try action="context2/action2" or action="/context2/action2"

- Brent
 
Gajanan Kulkarni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in my web.xml
for config/module1 , i have struts-module1.xml
for config/module2 , i have struts-module2.xml

in one of the action associated with module1 I want to fw request to another action in module2

<forward name="riskAssessment" path="module2/module2Action.do" > </forward>

inside struts-module2.xml
I have action tag for module2Action

Q:
This arrangement works on websphere and server forwards request to module2Action.
However same doesnt works in weblogic...Any comments about this??
 
reply
    Bookmark Topic Watch Topic
  • New Topic