File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Two Seperate actions for one jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Two Seperate actions for one jsp page" Watch "Two Seperate actions for one jsp page" New topic
Author

Two Seperate actions for one jsp page

Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
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.....



[Thumbnail for image.png]

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10290
    
168

Dipali yadav wrote:check attached image


What about it and what's the question?

[My Blog] [JavaRanch Journal]
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
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

Joined: May 21, 2012
Posts: 22
Ohh... It means there is no solution for this....
Gopakumar Naryanan
Ranch Hand

Joined: Jan 15, 2011
Posts: 72

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.

Thanks & Regards
Gopakumar
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
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

Joined: Jan 15, 2011
Posts: 72

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

Joined: May 21, 2012
Posts: 22
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two Seperate actions for one jsp page