Hi,
I am getting the error
"java.lang.IllegalArgumentException: Path page.welcome does not start with a
"/" character " when trying to display a jsp.
The tile definition is given as an Action forward path. This is the first
page after login.
And I am not sure if the tiles plugin in struts-config.xml is configured
properly.
The following is the error log. Struts-config.xml, tiles-defs.xml are also
included.
HTTP Status 500 -
-----------------------------
*type * Exception report
*message *
*description * *The server encountered an internal error () that prevented
it from fulfilling this request.*
*exception *
java.lang.IllegalArgumentException : Path page.welcome does not start
with a "/" character
org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:1062)
org.apache.struts.tiles.TilesRequestProcessor.doForward (
TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(
RequestProcessor.java:455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig
(TilesRequestProcessor.java :320)
org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java
:1482)
org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward (
RequestProcessor.java
:1069)
org.apache.struts.tiles.TilesRequestProcessor.doForward(
TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(
RequestProcessor.java :455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig
(TilesRequestProcessor.java:320)
org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process (ActionServlet.java
:1482)
org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
*note * *The full stack trace of the root cause is available in the Apache
Tomcat/5.5.16 logs.*
------------------------------
Apache Tomcat/5.5.16
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 >
< data-sources />
< form-beans >
< form-bean name = "loginForm"
type = " com.lynx.struts.form.LoginForm" />
</ form-beans >
< global-exceptions />
< global-forwards />
< action-mappings >
*<action path="/welcome" *
* type=" com.lynx.struts.action.WelcomeAction">
<forward name="success" path="page.welcome" />
</action>*
< action
attribute = "loginForm"
input = "/index.jsp"
name = "loginForm"
path = "/login"
scope = "request"
type = "com.lynx.struts.action.LoginAction" >
* <forward name="success" path="/welcome.do" />***
< forward name = "failure" path = "/index.jsp" />
</ action >
< action path = "/masterMenu" type = "
com.lynx.struts.action.MasterMenuAction" >
< forward name = "success" path = "/pages/success.jsp" />
</ action >
< action path = "/masterMenuInfo"
type = "com.lynx.struts.action.MasterMenuInfoAction " >
< forward name = "success" path = "/pages/success.jsp" />
</ action >
</ action-mappings >
< controller
processorClass = "org.apache.struts.tiles.TilesRequestProcessor "
bufferSize = "4096"
debug = "0"
inputForward = "true" />
< message-resources parameter = "com.lynx.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 >
</ struts-config >
*tiles-defs.xml*
***********************
**<? xml version = "1.0" encoding = "UTF-8" ?>
< tiles-definition >
< tile definition = "page.main" path = "pages/welcome.jsp" >
< put name = "header" value = "/pages/header.jsp" />
< put name = "masterMenu" value = "/masterMenu.do" />
< put name = "masterMenuItems" value = "/masterMenuItems.do" />
< put name = "footer" value = "/pages/footer.jsp" />
</ tile >
< tile definition = "page.welcome" extends = "page.main" >
< put name = "title" value = "Back Office" />
< put name = "body" value = "/pages/index.jsp" />
</ tile >
</ tiles-definition >
file locations
**************
Project Root
|___src
| |___com
| |___lynx
| |___struts
| |___action
| | |__LoginAction.java
| | |__WelcomeAction.java
| | |__MasterMenuAction.java
| | |__MasterMenuInfoAction.java
| |___form
| |____LoginForm.java
|
|___WebRoot
|___pages
| |__error.jsp
| |__footer.jsp
| |__welcome.jsp
| |__header.jsp
| |__success.jsp
|
|___WEB-INF (includes all struts tlds)
| |__struts-tiles.xml
| |__tiles-defs.xml
| |__web.xml
|___index.jsp
Regards,
Amulya