Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Navigating using a link

 
Sege Stephen
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys, I am strut newbie, I haven't really read much before working on struts. So I am just about to start reading it up, but in the main time I need help. I do apologise if this has already be covered somewhere else, I can't find it.

Basically, the app I am working on goes straight to the index page when you start it, and everything is control by strut action. What I want to do is to have a page before the home(index) page which I will call build page. And on this build page, there will two links, one like will take me to the home page of my application, and the other link will take me to the home page of a slightly older application.

Right, I have been able to make changes to make the application point to the build page, but I don't know how to point the link from the build page to point to my application.


Here is the Strut action code

code.........

<action path="/Tiles/getinvref"
type="Actions.InvoiceRefAction"
name="invoiceReferenceForm" scope="request"
input="/Tiles/index.jsp"
validate="false">
<forward name="success" path="/Tiles/index.jsp"/>
</action>



THE ABOVE CODE TAKES ME TO THE HOME PAGE WHEN APP IS LAUNCHED, WHEN I CHANGED IT TO THE CODE BELOW , IT TAKES ME TO THE BUILD PAGE.

how do i link the build page to the index page? i want user to click on a link and it takes them to home page.

<action path="/Tiles/getinvref"
type="Actions.InvoiceRefAction"
name="invoiceReferenceForm" scope="request"
input="/Tiles/buildPage.jsp"
validate="false">
<forward name="success" path="/Tiles/buildPage.jsp"/>
</action>

Thanks for your help
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"JStephen",
Please check your private messages.
 
Sege Stephen
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still waiting for help.

I have two pages . I want to link page1.jsp to page2.jsp. On page1.jsp, there is a link which says

Link to Page 2.

I want to use strut action to map the link, what do I call my link or how do I map it in the strut config.xml file. As in how does it knows when I click the link, that is supposed to go to page 2. This is what I have in my page1.jsp file

<li><a href="page2.jsp"/>New Build</a></li>
Do I need to add any code in the jsp file to Identify the link, or do I need to add anything to my action class. I am very new to struts. Here is a sample of my mapping file. Thanks

<action path="/getinvref"
type="Actions.InvoiceRefAction"
name="invoiceReferenceForm" scope="request"
input="/page2.jsp"
validate="false">
<forward name="success" path="/page2.jsp"/>
</action>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic