• 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

Struts-config.xml

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working in struts1.1. I have 2 jsps (main.jsp and main1.jsp) and only one form (form1.java). only one action(MainAction.java).
I have created only one form and action because validation and business logic are almost same.
so in struts-config.xml

<action name="form1" input="main.jsp" path="/mainAction" type="com.action.MainAction" scope="session" parameter="operation">
<forward name="newTransaction" path="main.jsp" redirect="no"/>
<forward name="updatedTransaction" path="main1.jsp" redirect="no"/>
</action>

Now, when i am in main1.jsp and i submit page then if validate() method from form1 raise error then it opens main.jsp not main1.jsp.
I want to open main.jsp.
and this problem is coming because of input="main.jsp" I have written in action tag.

Please can you advice, what can i do?

thanks in advance
 
Ranch Hand
Posts: 41
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand what is the action you want to submit after main1.jsp being validated. So there should be one more action mapping in config.xml to validate main1.jsp
 
Rajni Patel
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have one form for 2 jsps and one action class for same 2 jsps.

I have did this because there is same field in both jsps and almost same vlidation logic.
If i don't use 2 jsps then it is more complecation for some button.
its big application. this is just example.
 
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic