Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two Seperate actions for one jsp page

 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see the below image....
I am working with struts 2....... There are two jsp pages 1. global menu 2. basic data page
I have included globalmenu.jsp into basicdata.jsp
Since this globalmenu.jsp will be use by all jsp pages into my application...
I want to write a common code in a 1 single action, which will contain all results for the links on global menu
And also I want to write an another action for other part of the page.

My code is something like this:

globalmenu.jsp



basicdata.jsp



In short I want to write a 1 common action for menu links which i highlighted in the image.....

I am waiting for reply

Thanks in advance.....
image.png
[Thumbnail for image.png]
chek image
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dipali yadav wrote:check attached image


What about it and what's the question?
 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:
Dipali yadav wrote:check attached image


What about it and what's the question?


I was editing the questions.......Please have a look on it now....

Thank you for your reply.
 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh... It means there is no solution for this....
 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you can use tiles framework to include menu and the rest is same story. I have not worked on struts 2, please try if my words make any sense.
 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gopakumar Naryanan wrote:i think you can use tiles framework to include menu and the rest is same story. I have not worked on struts 2, please try if my words make any sense.


Thank you for your reply.....

I tried this already...but i think it is increasing number of jsp pages....
but any ways, i got the solution....and nw it is working as per my requirement...

Thanks a lot......
 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to know that you got the solution. Tiles framework will not let you increase number of JSPs if you use tiles-definition.xml .

Please share your solution to avoid someone to raise a new thread for the same issue
 
Dipali yadav
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gopakumar Naryanan wrote:Glad to know that you got the solution. Tiles framework will not let you increase number of JSPs if you use tiles-definition.xml .


okk... I ll try this.

Please share your solution to avoid someone to raise a new thread for the same issue


I did some changes into globalmenu.jsp


<html>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="220px">
<tr>
<td class="nav-links">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="gfx/logo_lisa.png" width="220" height="70" />

<img width="5" height="10" src="gfx/transparent.gif" />
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkBasicdata"
key="basicdata.headline" cssClass="nav-link" value="basicdata"
action="navlinkActionBasicData"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkDisplay"
key="display.headline" cssClass="nav-link"
action="navlinkActionDisplay"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkMailnotification"
key="mailnotification.headline" cssClass="nav-link"
action="navlinkActionMail"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkPackagefiles" key="packagefiles.headline"
cssClass="nav-link" action="navlinkActionPackage"></s:submit></td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkDhlTrackTrace" key="dhltnt.headline"
cssClass="nav-link" action="navlinkActionDhl"></s:submit></td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkPrintlayout"
key="printlayout.headline" cssClass="nav-link"
action="navlinkActionPrint"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkFTP"
key="ftp.headline" cssClass="nav-link" action="navlinkActionFtp"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkManufacturing"
key="providemanufacturing.headline" cssClass="nav-link"
action="navlinkActionManufacturing"></s:submit>
</td>
</tr>
</table> <img width="5" alt="placeholder2" height="100"
src="gfx/transparent.gif" />
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="nav-button"><s:submit name="submitButtonPrint"
key="globalmenu.button.print" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonCancel"
key="globalmenu.button.cancel" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonSave"
key="globalmenu.button.save" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td><hr />
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitButtonUserManagement"
key="globalmenu.button.usermanagement" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonLogout"
key="globalmenu.button.logout" cssClass="nav-button" action="navlinkActionLogout"></s:submit>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="180">
<tr class="lisa_version">
<td>Ver: 2.2.4 - 24.11.2009</td>
</tr>
</table></td>
</tr>
</table>
</body></html>


And poiting these all actions to the same result. For this I have created a seperate vavlinkAction.java




And finally added these actions in struts.xml

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic