Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Problem Using Tiles

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Marshal
Posts: 67343
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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"
 
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!