Hello,
I have just started to learn HTMLB. Am trying this simple program shich would just display the fields entered/selected by user.
Am getting an error as " Error occurs during the rendering of jsp component".
On checking the error code, it said:
"Exception ID:12:58_04/11/05_0139_9994750
[EXCEPTION]
#1#<b>com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource.</b>
Component : pcd:portal_content/Uday/Self_Study/DisplaySelection_Sample2
Component class : com.sap.sample.UserInfoDynPage
at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:444)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
Caused by: com.sapportals.portal.prt.component.PortalComponentException: Error occurs during the compilation of java generated from the jsp
at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:109)
at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
... 38 more
Caused by: com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: <b>Error occurs during the rendering of jsp component</b>
at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2189)
at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:81)
at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:140)
at com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:279)
at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:129)
... 41 more
<b>CODE:</b>
<u>UserInfoDynPage.java</u>
package com.sap.sample;
import com.sap.sample.bean.*;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.*;
import com.sapportals.htmlb.event.*;
import com.sapportals.htmlb.page.*;
import com.sapportals.portal.htmlb.page.*;
import com.sapportals.portal.prt.component.*;
import com.sapportals.htmlb.InputField;
import com.sapportals.htmlb.DropdownListBox;
public class UserInfoDynPage extends PageProcessorComponent
{ public DynPage getPage()
{ return new UserInfoDynPageDynPage();
}
public static class UserInfoDynPageDynPage extends JSPDynPage
{ //private UserInfoBean UserInfoBean = null;
private String searchString, searchType;
private int STATE;
private final static int STATE_GETSEARCH=1;
private final static int STATE_DISPLAYRESULTS = 2;
private final static int STATE_ERROR = -1;
public UserInfoBean userInfoBean;
public void doInitialization()
{ STATE=STATE_GETSEARCH;
}
public void doProcessAfterInput() throws PageException
{ Component c = getComponentByName("search");
if(c instanceof InputField)
searchString = ((InputField) c).getString().toString();
c=getComponentByName("searchType");
if(c instanceof DropdownListBox)
searchType = ((DropdownListBox)c).getSelection();
}
public void doProcessBeforeOutput() throws PageException
{ switch(STATE)
{ case STATE_GETSEARCH : { this.setJspName("UserInfo.jsp");
break;
}
case STATE_DISPLAYRESULTS : { saveContext();
this.setJspName("DisplayUserInfo.jsp");
break;
}
default : this.setJspName("UserInfo.jsp");
}
}
public void onSearchPressed(Event e)
{ STATE = STATE_DISPLAYRESULTS;
}
private void saveContext()
{ IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
if(searchString !=null)
request.putValue("sKey", searchString);
if(searchType !=null)
request.putValue("sType",searchType);
}
}
}
-
<u>UserInfoBean.java</u>
package com.sap.sample.bean;
import java.io.Serializable;
public class UserInfoBean implements Serializable
{ private String searchKey, searchType;
public String getSearchKey()
{ return searchKey;
}
public String getSearchType()
{ return searchType;
}
public void setSearchKey(String searchKey)
{ this.searchKey = searchKey;
}
public void setSearchType(String searchType)
{ this.searchType = searchType;
}
}
-
<u>UserInfo.jsp</u>
<%@ taglib uri="tagLib" prefix="hbj" %>
<jsp:useBean id="userInfoBean" type="request" class="com.sap.sample.bean.UserInfoBean" />
<hbj:content id="myContext" >
<hbj:page title="UserInfo Page">
<hbj:form id="myFormId" >
<hbj:textView id="title"
text="Search Screen"
design="HEADER2"
/>
<table>
<tr>
<td>
<hbj:label id="lb_Search"
text="Search For"
labelFor="search"
/>
</td>
<td>
<hbj:inputField id="search"
type="string"
maxlength="25"
/>
</td>
</tr>
<tr>
<td>
<hbj:label id="lb_SearchType"
text="Search Type"
labelFor="searchType"
/>
</td>
<td>
<hbj:dropdownListBox id="SearchType" tooltip="UME Object to search for" disabled="false">
<hbj:listBoxItem key="user" value="User" />
<hbj:listBoxItem key="group" value="Group" />
<hbj:listBoxItem key="role" value="Role" />
</hbj:dropdownListBox>
</td>
</tr>
</table>
<br>
<hbj:button id="submit" text="Search!" tooltip="Click me to search" disabled="false" design="emphasized" onClick="SearchPressed" />
<br>
<br>
</hbj:form>
</hbj:page>
</hbj:content>
-
DisplayUserInfo.jsp
<%@ taglib uri="tagLib" prefix="hbj" %>
<jsp:useBean id="userInfoBean" type="request" class="com.sap.sample.bean.UserInfoBean" />
<% String sKey = (String) componentRequest.getValue("sKey");
String sType = (String)componentRequest.getValue("sType");
%>
<hbj:content id="myContext" >
<hbj:page title="UserInfo Page">
<hbj:form id="myFormId" >
<hbj:textView id="title"
text="Display Results"
design="HEADER2"
/>
<table>
<tr>
<td>
<hbj:label id="lb_Search"
text="Search Results"
labelFor="search"
/>
</td>
<td>
<hbj:textView id="search "
text="<%=sKey%>"
design="emphasized"
/>
</td>
</tr>
<tr>
<td>
<hbj:label id="lb_SearchType"
text="Search Type"
labelFor="searchType"
/>
</td>
<td>
<hbj:textView id="search "
text="<%=sType%>"
design="emphasized"
/>
</tr>
</table>
<br>
<br>
</hbj:form>
</hbj:page>
</hbj:content>
-
<u> portalapp.xml</u>
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="UserInfoDynPage">
<component-config>
<property name="ClassName" value="com.sap.sample.UserInfoDynPage"/>
<property name="JSP" value="pagelet/UserInfo.jsp"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
-
Please help.
Awaiting Reply.
Thanks,
Uday
Message was edited by: Uday Hardikar