Solved

Error when I execute an action using links

Posted on 2011-03-23
5
296 Views
Last Modified: 2012-05-11
Hi Friends,

Problem
Getting into an endless loop when I am clicking on a edit link which leads me to an edit Page.

Struts 2, Tiles

JSP Code
 
<s:iterator value="list" status="listStatus">
<s:url id="editURL" action="EditAction">
<s:param name="type" value="%{type}"></s:param>
</s:url>
<s:a href="%{editURL}">Edit</s:a>
</s:iterator>

Open in new window


Tiles
 
<definition name="Page1" extends="baseLayout">
      <put-attribute name="title"  value="Page1"/>
      <put-attribute name="body"   value="/Page1.jsp"/>      
</definition>

Open in new window


Struts
 
<action name="EditAction" method="EditAction" class="grouping.master.action.Action">
<result  name="success" type="tiles">Page1</result>
</action>

Open in new window


The error what I am getting
 
at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:175)
	at java.io.PrintWriter.flush(PrintWriter.java:276)
	at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:175)
	at java.io.PrintWriter.flush(PrintWriter.java:276)
	at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:175)
	at java.io.PrintWriter.flush(PrintWriter.java:276)
	at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:175)
	at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:222)
	at org.apache.jsp.baseLayout_jsp._jspx_meth_tiles_005finsertAttribute_005f1(baseLayout_jsp.java:387)
	at org.apache.jsp.baseLayout_jsp._jspService(baseLayout_jsp.java:300)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650)
	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644)
	at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
	at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
	at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
	at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:659)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:678)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:633)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322)

Open in new window


I am getting blank page as result.

I am clueless whats going wrong in this. Any help will be appreciable. Thanks in Advance
0
Comment
Question by:JeraldFernando
  • 3
  • 2
5 Comments
 

Author Comment

by:JeraldFernando
ID: 35197792
I managed to see what causes the error in the long list....

Caused by: org.apache.tiles.impl.CannotRenderException: JSPException including path '/Page1.jsp'.

Can you please help me on this
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35198005
is this ur calss name ??
Action">   why you put name like this its reserved word so change the name and try !
0
 

Accepted Solution

by:
JeraldFernando earned 0 total points
ID: 35213719
The error was with the jsp file. I dont know what is the real issue but what I did was I copied working jsp file in the tiles section and then used the contents of this error giving page to that one and miraculously it started working

@  Dravid
The Action word doesnt have anythig to do with the error. Thanks for the support.
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35213761
But Action is the already defined clss in struts so it cause the problem . Any try to change the name . Dont use reserved words ...
0
 

Author Closing Comment

by:JeraldFernando
ID: 35252664
Work around which was of timely help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now