I am new to Websphere Portal. I am using RAD 6.0 .When I create a Portlet using wizard "New Project->Portlet Project (JSR 168)"
Its giving error cannot resolve renderRequest object. I have imported portlet.jar and std-portet.tld in WEB-INF/tld. The code is given below.
TestingPortletView.jsp
<%@ page session="false" contentType="text/html" import="java.util.*,javax.portlet.*,testing.*" %>
<%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>
<%
TestingPortletSessionBean sessionBean = (TestingPortletSessionBean)renderRequest.getPortletSession().getAttribute(TestingPortlet.SESSION_BEAN);
%>
<DIV style="margin: 6px">
<H3 style="margin-bottom: 3px">Welcome!</H3>
This is a sample <B>view mode</B> page. You have to edit this page to customize it for your own use.<BR>
The source file for this page is "/WebContent/testing/jsp/html/TestingPortletView.jsp".
<H3 style="margin-bottom: 3px">Order entry</H3>
This is a sample form to test action handling.
<DIV style="margin: 12px; margin-bottom: 36px">
<% /******** Start of sample code ********/ %>
<%
String formText = sessionBean.getFormText();
if( formText.length()>0 ) {
%>
Order details for order id '<%=formText%>' should be displayed here.
<%
}
%>
<FORM method="POST" action="<portlet:actionURL/>">
<LABEL for="<%=TestingPortlet.FORM_TEXT%>">Enter order id:</LABEL><BR>
<INPUT name="<%=TestingPortlet.FORM_TEXT%>" type="text"/>
<INPUT name="<%=TestingPortlet.FORM_SUBMIT%>" type="submit" value="Submit"/>
</FORM>
<% /******** End of sample code *********/ %>
</DIV>
</DIV>
I haven't added even a single line of my own in the code is Wizard generated.
Thanks
Anamika
I tried running the jsp file (after ignoring the same). But still getting error as shown below :
[2/16/06 12:52:39:314 IST] 38be566d WsServer A WSVR0001I: Server server1 open for e-business
[2/16/06 12:52:50:672 IST] 7d29166c WebGroup E SRVE0026E: [Servlet Error]-[File "http://java.sun.com/portlet" not found]: org.apache.jasper.JasperException: File "http://java.sun.com/portlet" not found
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:330)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1382)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:949)
at org.apache.jasper.compiler.ConfigurableParseEventListener.handleDirective(ConfigurableParseEventListener.java:161)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:125)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1155)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1113)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1109)
in web.xml the taglib defintion was given as :
<taglib id="PortletTLD">
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/std-portlet.tld</taglib-location>
</taglib>
but there was no tld folder in WEB-INF. so I put created one folder and put std_portlet.tld ver 1.0 after that i gave me the error saying class not found "org.apache.pluto.tags.DefineObjectsTag" so I imported External jar pluto1.0.jar in lib folder. But still I got the error "Unable to load class com.ibm.wps.pe.pc.legacy.tags.InitTag "
I unable to get the package for the same. Its not there in "wp.pe.api.legacy.jar". I know there is some blunder.
Thanks and Regards
Anamika
WEB-INF refered in this web.xml actually refers to the folder "<<portal
install>>\shared\app\WEB-INF\tld" You should be having the tld file in
this folder.
Regards.
I'm having the exact same problem with RSA 6.0.1-generated JSR-168 JSF
Portlets. When deployed onto the server, the Portlet gacks on a JSP
Processing Error and renders as a large dump of the problem ("Cannot
resolve symbol: variable renderRequest" along with 100 lines of trace).
Did you manage to find a resolution? I found that reverting to JSR 168
"Basic" Portlets avoided the problem, but that's not of much use since
I need the JSF components.
Thanks,
-Joe