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.
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.