Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to have a common jsp page for different action name but have same layout  RSS feed

 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Greetings for the day. I have developed a web portal using jsp and struts 2. I have approximately 10 JSP pages which looks exactly the same and have two text areas and two hidden fields. All 10 pages are exactly the same except for hidden field value. Can't i have a single common jsp page. How can i achieve it. A sample page i am attaching...





As this is an Assignment page so hidden field value is assignment. If the page is OBJECTIVEs then value will be OBJECTIVE.



How can i do that?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the whole point of JSP is to be able to do things like that. Upon what criterial can you discern the differences between the pages? In other words, what data can be used to determine what goes on each different version of the page?
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Yes, the whole point of JSP is to be able to do things like that. Upon what criterial can you discern the differences between the pages? In other words, what data can be used to determine what goes on each different version of the page?


The hidden form field will distinguish the data.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so it sounds like you'll need conditions (<c:if>, <c:choose>, etc) to control the difference in the JSP based upon the value of the submitted hidden field.
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes something like that. But i don't know how to do it. Kindly let me know.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you start here and here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!