R
ros
Hello,
I have 2 hyperlinks on a jsp page in my Struts with Tiles application.
I am a bit confused about how to write the action-mapping for these
links in the struts-config file.
Would be really thankful if someone helps me with this. I have pasted
the files below.
Thanks
Ros
menu.jsp
-------------
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<div><H2>Menu Items</H2>
<p></p>
<p><a href="/helloworld.jsp">Hello World</a></p>
<p><a href="/hellotile.jsp">Hello Tile</a></p>
</div>
tiles-defs.xml
-------------------
<definition name=".baseLayout" path="/WEB-INF/jsp/layouts/
baselayout.jsp">
<put name="title" value="Base Layout"/>
<put name="footer" value="/WEB-INF/jsp/common/footer.jsp"/>
<put name="hellotile" value="/WEB-INF/jsp/common/
hellotile.jsp"/>
</definition>
<definition name=".helloWorld" extends=".baseLayout">
</definition >
struts-config.xml
------------------------
<action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/welcome"
forward=".helloWorld"/>
<action
path="/helloworld"
forward=".helloWorld"/>
<action
path="/hellotile"
forward="hellotile.jsp"/>
</action-mappings>
I have 2 hyperlinks on a jsp page in my Struts with Tiles application.
I am a bit confused about how to write the action-mapping for these
links in the struts-config file.
Would be really thankful if someone helps me with this. I have pasted
the files below.
Thanks
Ros
menu.jsp
-------------
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<div><H2>Menu Items</H2>
<p></p>
<p><a href="/helloworld.jsp">Hello World</a></p>
<p><a href="/hellotile.jsp">Hello Tile</a></p>
</div>
tiles-defs.xml
-------------------
<definition name=".baseLayout" path="/WEB-INF/jsp/layouts/
baselayout.jsp">
<put name="title" value="Base Layout"/>
<put name="footer" value="/WEB-INF/jsp/common/footer.jsp"/>
<put name="hellotile" value="/WEB-INF/jsp/common/
hellotile.jsp"/>
</definition>
<definition name=".helloWorld" extends=".baseLayout">
</definition >
struts-config.xml
------------------------
<action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/welcome"
forward=".helloWorld"/>
<action
path="/helloworld"
forward=".helloWorld"/>
<action
path="/hellotile"
forward="hellotile.jsp"/>
</action-mappings>