Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Page Cannot Be Displayed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi im a newbie in struts and im getting a hard time making struts 1.3.5 work in RAD 6. i created a simple struts application, just having a jsp with link that will go the the next jsp that will show data (data are statically populated by another java bean). everytime i click the link im getting Page Cannot Be Displayed. Both jsps are in WebContent/jsp. In the actionmapping i already tried input="/jsp/bookList.jsp" and input="jsp/bookList.jsp", but still not working.

code in the 1st page:
<html:link action="bookList">Show the booklist</html:link>

actionmapping in struts-config
<action path="/bookList" name="bookListForm"
scope="request"
type="com.library.BookListAction"
input="/jsp/bookList.jsp"/>

formbean in struts-config
<form-bean name="bookListForm" type="com.library.BookListForm"/>
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your action mapping appears to be incorrect. In order for the control to pass from your BookListAction class to the bookList.jsp, you must specify a forward that tells Struts where to go next. So, your action mapping should look something like this:


When you code the execute method in your BookListAction, the last statement should be:

This tells Struts to forward to the bookList.jsp once the Action is complete.

One more thing: When referencing an action, it's best to include the initial "/". So, your link would look like this:

<html:link action="/bookList">Show the booklist</html:link>
[ October 19, 2006: Message edited by: Merrill Higginson ]
 
Evildoers! Eat my justice! And this tiny ad's justice too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic