Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a jsp page from another jsp page in struts

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
How to call a jsp page from another jsp page in struts. basically we dont need to write any action class we will specify the following action element in struts-config.xml

<action
path="/home"
parameter="/index.jsp"
type="org.apache.struts.actions.ForwardAction"
scope="request"
validate="false">
</action>
and in jsp page we will write code with /home... can anyone provide the code to be written in jsp

Thanks in advance
saiprasanna
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just create a link:

<html:link action="/home">Click here</html:link>
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill
but we are not using struts-html taglibs can you specify in normatl html format.

Thanks in advance
saiprasanna
 
padma jenifer
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am afraid that i understand your question or not..you can use <a href="html page name" >click here</a>
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi padma
what you specified is correct in normal situation i.e when we are using MVC 1 architecture.but in struts every request should be specified in struts-config.xml(i.e controller)
regards
saiprasanna
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<a href="<%=request.getContextPath()%>/home.do">Click</a>
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Why dont you try

<a href="./home.do">Click<a>

Regards
[ August 10, 2006: Message edited by: A Kumar ]
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dom & Kumar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic