Struts not detecting tiles based forwards

Hi,

I am new to struts and tiles; would appreciate your help in solving this issue:

I am using struts along with the tiles plugin in my application. When i try to access a URL (http://localhost:8080/mysite/index.do) mapped to a tiles forward, i am getting the following exception.

javax.servlet.ServletException: Path forum.index does not start with a"/" character

org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)

org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)

javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The following is an extract from my struts-config.xml

<action-mappings>

<action path="/index"forward="forum.index" />

</action-mappings>

<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" />

</plug-in>

And the forward 'forum.index' is defined in my tiles-defs.xml as

<definition name="forum.index" extends="forum.default">

<put name="content" value="/WEB-INF/tiles/pages/index.jsp" />

<put name="pagename" value="Home" />

</definition>

The definition 'forum.default' is not shown, but is present in the tiles-defs.xml...

Could you please tell me what i am doing wrong?

This technique was working when i was using NetBeans 5.5.. But now after porting the application to Eclipse + WTP + Tomcat 5.5, i am getting this error.

Your help is appreciated.

Thanks and regards,

Rakesh TA

[2229 byte] By [Rakesh.TAa] at [2007-11-26 14:55:41]
# 1

Hi

Did you solve your problem?

i tried this : http://sabrenews.blogspot.com/2007/01/javaxservletservletexception-path.html but it didn't work.

still stucked with this message

javax.servlet.ServletException: Path template.jsp does not start with a "/" character

org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)

org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)

javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

any help is appreciated

antwakea at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Rakesh,did u find the solution for that exception make sure u follow the steps explained in the blog http://sabrenews.blogspot.com/2007/01/javaxservletservletexception-path.html
RajeshPGa at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi,

could somebody explain what the dot between forum.index is used for?

<definition name="forum.index"

and also, some tutorial using

><action path="/index" parameter="layout"/>

and here use

<action path="/index" forward="forum.index"/>

Can somebody tell me when to use parameter and when to use forward?

Thanks a lot.

sunAccounta at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
hi,actually parameter can be used to pass extra information to the Action selected by this ActionMapping.forward is the context-relative path of the resource that should serve this request via a forward.Exactly one of the forward, include, or type properties must be
CookBookJa at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
the parameter attribute in action tag is used when you are using DispatchAction instead of Action class to handle the request and response forward parameter is used to forward a request to a jsp page Rajeshwww.rajeshpg.com
RajeshPGa at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Hello,

Two years passed, this problem alos hits me.

Finally what is the solution?

Thanks.

Pengyou

> Hi,

>

> I am new to struts and tiles; would appreciate your

> help in solving this issue:

>

> I am using struts along with the tiles plugin in my

> application. When i try to access a URL

> (http://localhost:8080/mysite/index.do) mapped to a

> tiles forward, i am getting the following exception.

> > javax.servlet.ServletException: Path forum.index does

> not start with a "/" character

> org.apache.struts.chain.ComposableRequestProcessor.pr

> ocess(ComposableRequestProcessor.java:283)

> org.apache.struts.action.ActionServlet.process(Action

> Servlet.java:1858)

> org.apache.struts.action.ActionServlet.doGet(ActionSe

> rvlet.java:446)

> javax.servlet.http.HttpServlet.service(HttpServlet.ja

> va:689)

> javax.servlet.http.HttpServlet.service(HttpServlet.ja

> va:802)

> The following is an extract from my

> struts-config.xml

> ><action-mappings>

> <action path="/index"forward="forum.index"

> />

></action-mappings>

> <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" />

></plug-in>

> ode]

> And the forward 'forum.index' is defined in my

> tiles-defs.xml as

> [code]

> <definition name="forum.index"

> extends="forum.default">

> <put name="content"

>value="/WEB-INF/tiles/pages/index.jsp" />

><put name="pagename" value="Home" />

> definition>

>

> The definition 'forum.default' is not shown, but is

> present in the tiles-defs.xml...

>

> Could you please tell me what i am doing wrong?

>

> This technique was working when i was using NetBeans

> 5.5.. But now after porting the application to

> Eclipse + WTP + Tomcat 5.5, i am getting this error.

>

> Your help is appreciated.

>

> Thanks and regards,

> Rakesh TA

pengyoua at 2007-7-8 8:44:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...