Reputation: 7386
For example on our index.jsp
contains only one link:
<a href="<s:url action='viewBook'/>">Your Book</a>
In browser on index.jsp
page I see this link:
http://localhost:8080/project/viewBook.action
when I click on this link opened page and in browser address line I see next address:
http://localhost:8080/project/viewBook.action
struts.xml
contains next lines for action listTicket:
<action name="viewBook" class="BookAction" method="view">
<result>pages/book.jsp</result>
</action>
My question: what I must change, that instead viewBook.action in browser I see link to the Page:
http://localhost:8080/project/book.jsp
I try set for result tag type="redirect". But in this case - page empty.
Upvotes: 1
Views: 1308
Reputation: 160321
You won't see the backing view file shown in the URL, nor should you want to. View mechanics are an abstraction and not shown in essentially all MVC frameworks.
You'll see viewBook.action
(assuming default action extension) if you redirect to the action using a "redirectAction"
result type. This is the desired URL.
Upvotes: 3
Reputation:
You should not do this.
You want the url to link to your controller and not your jsp.
Upvotes: 3