cancel
Showing results for 
Search instead for 
Did you mean: 

Error in HTMLB program..Please help..Urgent

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Uday,

This error is due to the fact that you are using the tags of HTML instead of HTMLB. Tags like <b><table>, <tr>, <td></b> does not work for HTMLB. If you want to make a table as that of HTML then you must your <b>Layouts</b> which is provided by HTMLB.

Try and use <b>Grid Layout</b> for your code.

Hope this helps you!! <b>E-Mail: praveshv@hcltch.com</b>

Regards

Pravesh

Message was edited by: Pravesh Verma

Former Member
0 Kudos

Hi Pravesh,

mixing html code and htmlb components is of course supported. Thats the only reason why someone might use jsp.

regards,

Martin

Former Member
0 Kudos

Hi Martin and Pravesh,

The code im trying is same as the sample code got. Am getting an output using this sample code.

I just re-typing to understand the logic and flow of HTMLB programming.

Whatz wrong in my code.......

If you want I can send both you the par files. Plz send me your e-mail ids.

sob!sob! i have to re-do my coding over this after this solves and give my boss status.

Please help....help.

Thanks ,

Uday

pravesh_verma
Active Contributor
0 Kudos

Hi Martin,

Is it!!! Then I am sorry for my answer. I have not checked it in HTMLB. I am wondering that we have mentioned a taglib for the jsp in HTMLB and using the tags of HTML without using the taglibs as "hbj". Does that work??

Well anyways thanks for information.

Regards

Pravesh

darrell_merryweather
Active Contributor
0 Kudos

What about try to change the PrivateSharingReference to be either ServicesReference="htmlb" or SharingReference="htmlb"

What about try to change the PrivateSharingReference to be either ServicesReference="htmlb" or SharingReference="htmlb"

Also, I would remove the JSP property in the portalapp.xml file, as you only need this when using a jspnative component. The JSP page is then set in the DynPage component.

This may or may not help, but I hope it does.

As for mixing html and htmlb this is indeed entirely supported. You have the option of using htmlb, or html, or a combination of both. If your page is quite large then you would consider using html whereever possible so that you don't have problems with the jsp compilation. You can specify the taglib, but you don't actually need to use the tab library at all. The hbj is so that the compiler knows which tags are htmlb, and if they are, then they are compiled before the output is sent to the client.

I hope this clears up some things

Darrell

Message was edited by: Darrell Merryweather