Skip to Content
author's profile photo Former Member
Former Member

solve this error!!! urgent

hi all,

i have bean class,JSP Dynpage and JSP.when i run the portal it shows Error occurs during the rendering of jsp component.....for second JSP...first JSP is running fine...

bean class

===========

public class ClassFirst {

public String name;

public String designation;

public String location;

public void setName(String name) {

this.name=name;

System.out.println(name);

if(name.equals("purush")){

this.designation="pat";

this.location="tco";

} else {

this.designation="not known";

this.location="not known";

}

}

public String getName() {

return name;

}

public String getDesignation() {

return designation;

}

public String getLocation() {

return location;

}

}

JSP Dynpage

=============

package com.cts.purush;

import com.cts.puruh.ClassFirst;

import com.sapportals.htmlb.InputField;

import com.sapportals.htmlb.event.Event;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.portal.htmlb.page.JSPDynPage;

import com.sapportals.portal.htmlb.page.PageProcessorComponent;

import com.sapportals.portal.prt.component.IPortalComponentContext;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

import com.sapportals.portal.prt.component.IPortalComponentResponse;

public class DynFirst extends PageProcessorComponent {

public DynPage getPage(){

return new DynFirstDynPage();

}

public static class DynFirstDynPage extends JSPDynPage{

private final static int INITIAL_VALUE=0;

private final static int FINAL_VALUE=1;

private int state=INITIAL_VALUE;

public void doInitialization(){

}

public void doProcessAfterInput() throws PageException {

InputField inf=(InputField)getComponentByName("name");

IPortalComponentRequest request=(IPortalComponentRequest)this.getRequest();

IPortalComponentContext ctxt=request.getComponentContext();

IPortalComponentResponse response=(IPortalComponentResponse)this.getResponse();

ClassFirst myBean=new ClassFirst();

String n=inf.getValueAsDataType().toString();

myBean.setName(n);

state=FINAL_VALUE;

}

public void doProcessBeforeOutput() throws PageException {

IPortalComponentResponse response=(IPortalComponentResponse)this.getResponse();

switch(state) {

case INITIAL_VALUE:

this.setJspName("JspFirst.jsp");

break;

case FINAL_VALUE:

this.setJspName("JspSecond.jsp");

break;

}

}

public void Confirm(Event event)throws PageException {

IPortalComponentResponse response=(IPortalComponentResponse)this.getResponse();

state=FINAL_VALUE;

}

}

}

First JSP

==========

<%@ taglib uri="tagLib" prefix="hbj" %>

<jsp:useBean id="newBean" scope="application" class="com.cts.puruh.ClassFirst" />

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<hbj:inputField

id="name"

type="String"

width="250px"

value=" "

jsObjectNeeded="true">

</hbj:inputField>

<hbj:button

id="send"

text="submit"

tooltip="send"

onClick="Confirm"

width="100px"

disabled="false"

design="EMPHASIZED">

</hbj:button>

</hbj:form>

</hbj:page>

</hbj:content>

Second JSP

===========

<%@ taglib uri="tagLib" prefix="hbj" %>

<jsp:useBean id="newBean" scope="application" class="com.cts.puruh.ClassFirst" />

<hbj:content id="myContext">

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<hbj:textView

id="name"

text="<%=newBean.getName(); %>">

</hbj:textView>

<hbj:textView

id="designation"

text="<%=newBean.getDesignation(); %>">

</hbj:textView>

<hbj:textView

id="location"

text="<%=newBean.getLocation(); %>">

</hbj:textView>

</hbj:form>

</hbj:page>

</hbj:content>

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 04:30 PM

    Send me you par..will correct it!

    sapmails@gmail.com

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 26, 2005 at 04:31 PM

    Its better to include the errors in the log file instead of the code. It might be really obviously when looking at the error stack trace. When I say error I don't mean the error that is displayed on the screen when trying to view the iView, but the Java stack trace in log files

    D

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.