Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Problem while Reading Request attribute by using ${}

The "WCB: Java development" forum contains threads on issues that are related to Java while programming a WCB (WebManager Component Bundle). If you have questions that have impact on Java code, post them in this forum. Some example topics: authorization, the different component types, setting up component dependencies, data access, and so forth.

Answered
Not marked as answered yet

Forums  >  WCB: Java development  >  Problem while Reading Request attribute by using ${}


Author Problem while Reading Request attribute by using ${}
Ravi


Posts: 2

Posted: 31-10-2009 12:01

Hi All,
I'm integrating portal and servlet. I have a portlet and my requirement is to call a Servlet by dojo AJAX call from the portlet and need to fill the response text in the table.
I have implemented a servlet inside the same portlet war and called the servlet. I could able to call the servlet and its working fine. But my problem is i'm forwarding the servlet request as follows,
protected void doGet(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {
// TODO Auto-generated method stub
MyBean bean = new MyBean();
List myList = new ArrayList();
myList.add(new ClaimInfo());
myList.add(new ClaimInfo());
myList.add(new ClaimInfo());
bean.setClaimInfoList(myList);
aRequest.setAttribute("claimInformationList",bean);
RequestDispatcher myDispatcher = aRequest.getRequestDispatcher("ClaimStatusInformation.jsp");
myDispatcher.forward(aRequest, aResponse);
}
and my JSP is,
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<table style="margin:0; text-align:left; width:100%;"
class="tableStyle01" border="0" cellpadding="0" cellspacing="0" >
<thead>
<tr>
<th class="columnHeader">
<span class="fieldlabelleft1" style="text-align:left">
Loss Date
</span>
</th>
<th class="columnHeader">
<span class="subheadwhite" style="text-align:left">
Claim
</span>
</th>
</tr>
</thead>
<tbody>
<c:forEach items="${claimInformationList.claimInfoList}" var="claimInfo" varStatus="claimRowStatus">
<tr>
<td>
<span style="width:100%;text-align: left">
<c:out value="${claimInfo.displayLossDate}" escapeXml="false"></c:out>
</span>
</td>
<td>
<span style="width:100%;text-align: left">
<c:out value="${claimInfo.claimNumber}" escapeXml="false"></c:out>
</span>
</td>
</tr>
</c:forEach>
</tbody>
</table>

___________________________________________________________

The dojo response data does not contains the actual parsed value for the JSP.
for the statement ${claimInfo.claimNumber} it either has to have blank or the actual value for that, Instead of above i'm getting the string "${claimInfo.claimNumber}" in the response text.
I find difficulty to resolve this. Please share your ideas.
Thanks in advance.
Ravi.


williamb



Posts: 225

Posted: 31-10-2009 15:53 Solved

Hi Ravi,

If I understand your question correctly it's only about why the expression language (${ }) items arn't parsed, but simply put into html.

Is is possible that Expression Language has been disabled in some way. E.g. with <%@ page isELIgnored ="true|false" %> or in the web.xml (<el-ignored>true</el-ignored>).

Is for example ${presentationcontext} also printed as is?

Related resource: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html

Ravi


Posts: 2

Posted: 31-10-2009 16:19

Great William,
I used <%@ page isELIgnored="false"%> and its working fine now.
But earlier i did not have any statement like <%@ page isELIgnored="true"%>. Anyhow its solved now.
Thanks William!!!

williamb



Posts: 225

Posted: 31-10-2009 16:23

Ravi,

maybe it's good to check out why it's ignored (e.g. from web.xml or so), so you don't run into other problems that could be ahead.

In web.xml it should be configured somewhere under (web-app) 'jsp-config' > 'jsp-property-group' > 'el-ignored'.

ps. charset=ISO-8859-1? Why not use UTF-8?

Back to top

New message: "Problem while Reading Request attribute by using ${}"
Message:
bold boitalicd underline url quote code smile cool eek grin mad razz sad wink
 
© 2010 GX creative online development B.V.

Disclaimer

This website (GXdeveloperweb.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.