wood burning stoves 2.0*
The moose likes Struts and the fly likes Problem Using Tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem Using Tiles" Watch "Problem Using Tiles" New topic
Author

Problem Using Tiles

Java Clasics
Greenhorn

Joined: Sep 15, 2005
Posts: 2
Hi Folks,

I'm attempting to use struts tiles in my application.

I have the structure as follows.

one.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<tiles:get name="header"/>
<tiles:get name="menubar"/>
<tiles:get name="content"/>
<tiles:get name="footer"/>

two.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<bean efine id="jsppage" scope="request" name="content.jsp.page"/>
<bean efine id="menuitem" scope="request" name="menu.bar.to.display"/>

<tiles:insert template='one.jsp'>
<tiles ut name='header' content='header.jsp'/>
<tiles ut name='menubar' content='<%=menuitem%>'/>
<tiles ut name='content' content='<%=jsppage%>'/>
<tiles ut name='footer' content='footer.jsp'/>
</tiles:insert>

Most stuff is working fine, but when the jsp page tries to use that part of the tile (<tiles:get name="header" /> it crashes on me. A partial stack trace is below - if anybody really wants the whole thing let me know.

The basic error is a string index out of range error, from
java.lang.String.substring.

Any suggestion is highly appreciated.

Thanks in advance,
Krishna.

java.lang.StringIndexOutOfBoundsException: String index out of range: -15

at java.lang.String.substring(String.java:1444)

at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:251)

at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)

at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)

at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)

at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)

at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)

at _two._jspService(two.jsp:11)

at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)

at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)

at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)

at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)

at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)

at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)

at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)

at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)

at java.lang.Thread.run(Thread.java:534)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60055
    
  65

"Java Clasics",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff

P.S. You mispelled "Classics"


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Problem Using Tiles
 
Similar Threads
servlet exception in index page of my website.
Internal Server Error 500
Navigation not working
Tiles Error
Error on page