File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes In struts Can't display dynamic content using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "In struts Can Watch "In struts Can New topic
Author

In struts Can't display dynamic content using "include"?

Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
Hi everyone:
I am using struts1.1. I have a index.jsp and it have a hyperlink "<html:link forward="show">Show All forum</html:link>". In my struts-config.xml there is a element:"
<global-forwards>
..................................
<forward name="show" path="/jsp/allarticle.jsp"/>
<forward name="oneforum" path="/article.jsp"/>
..............
<action path="/article" type="lyo.hotmail.bbs.lovearticle.Savelovearticle" input="/jsp/error.jsp">
<forward name="success" path="/jsp/loveforum.jsp"/>
</action>
"
I want that the index.jsp will redirect to allarticle.jsp when user click the hyperlink "Show All forum".
In the allarticle there is a hyperlink "<html:link forward="oneforum">one forum</html:link>"
The Savelovearticle is an Action class and it disply all the data from database.I using "if(list!=null){
session.setAttribute("listtable",list);
}".I display all the content using "<logic:iterate id="love" name="listtable">
" tag in allarticle.jsp.
But the Tomcat report error "can't find listtable in any scope"?
The problem is if I change the struts-config.xml to:
////////////////////////after change///////////////////////////////////////////
<global-forwards>
..................................
<forward name="show" path="/article"/>
<forward name="oneforum" path="/article.jsp"/>
..............
<action path="/article" type="lyo.hotmail.bbs.lovearticle.Savelovearticle" input="/jsp/error.jsp">
<forward name="success" path="/jsp/loveforum.jsp"/>
</action>
"
It will display all the content successfully.Why?
Whether because that the Action is a servlet so it must retrieve a request directly.My first code don't send the request to the servlet other than send the request to a jsp page.The jsp page can't send the same request to the servlet so the error happened.right?
How do I fix it?Thks :roll:


When I face C# and Java I choose Java.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61196
    
  66

Moving to the Struts forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In struts Can't display dynamic content using "include"?