- This topic has 1 reply, 2 voices, and was last updated 18 years, 3 months ago by Riyad Kalla.
-
AuthorPosts
-
Hi! I’m testing Tiles… I had download one tutorial from laliluna… I’m create all the project, but I’m getting 2 errors:
The first one is in struts-config.xml, that indicate one error label at the end of the file. I had included the code…
The second is, when I want to test the page in the web… I write http://localhost:8080/LibraryWeb/welcome.do, and I getting the next error:
java.lang.IllegalArgumentException: La Trayectoria base.definition no comienza con carácter “/”.I need to run the project and i’m desperated …
Please see the files show below and give me your help… Thanks a lot…
______________________________________________________________________
The first one error:struts-config.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”><struts-config>
<controller processorClass=”org.apache.struts.tiles.TilesRequestProcessor” bufferSize=”4096″ debug=”0″></controller>
<message-resources parameter=”de.laliluna.tutorials.library.struts.ApplicationResources” />
<plug-in className=”org.apache.struts.tiles.TilesPlugin”>
<set-property property=”definitions-config” value=”/WEB-INF/tiles-defs.xml”/>
<set-property property=”moduleAware” value=”true”/>
<set-property property=”definitions-parser-validate” value=”true”/>
</plug-in><global-forwards>
<forward name=”welcome” path=”/welcome.do” redirect=”true” />
</global-forwards><action-mappings >
<action path=”/welcome” type=”de.laliluna.tutorials.library.struts.action.WelcomeAction”>
<forward name=”showWelcome” path=”page.welcome” />
</action>
<action path=”/bookList” type=”de.laliluna.tutorials.library.struts.action.BookListAction”>
<forward name=”showBookList” path=”page.booklist” />
</action>
<action path=”/navigation” type=”de.laliluna.tutorials.library.struts.action.NavigationAction”>
<forward name=”showNavigation” path=”/jsp/navigation.jsp” />
</action>
</action-mappings>X</struts-config> Here is the error indicated…
__________________________________________________________________
The second error:Estado HTTP 500 –
——————————————————————————–
type Informe de Excepción
mensaje
descripción El servidor encontró un error interno () que hizo que no pudiera rellenar este requerimiento.
excepción
java.lang.IllegalArgumentException: La Trayectoria base.definition no comienza con carácter “/”
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)nota La traza completa de la causa de este error se encuentra en los archivos de diario de Apache Tomcat/5.0.28.
——————————————————————————–
Apache Tomcat/5.0.28
__________________________________________________________________
tiles.def
<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<!DOCTYPE tiles-definitions PUBLIC
“-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN”
“http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd”><tiles-definitions>
<!– Base Tiles Definition –>
<definition name=”base.definition” path=”/jsp/siteLayout.jsp”>
<put name=”header” value=”/jsp/header.jsp”></put>
<put name=”navigation” value=”/navigation.do” />
<put name=”footer” value=”/jsp/footer.jsp” />
</definition><!– Tiles definiton of welcome page –>
<definition name=”page.welcome” path=”base.definition”>
<put name=”title” value=”Welcome page”></put>
<put name=”body” value=”/jsp/index.jsp” />
</definition><!– Tiles Definitiojn of BookList –>
<definition name=”page.booklist” path=”base.definition”>
<put name=”title” value=”Book list page”></put>
<put name=”body” value=”/jsp/bookList.jsp”></put>
</definition>
</tiles-definitions>
Riyad KallaMemberMovnig to OT > SOft Dev
Your struts file is out of order. The DTD that validates the struts file demands a certain ordering to your struts-config body contents, please refer to the DTD to see whtat the proper order is, or read the error that pops up, it tells you in there.
-
AuthorPosts