cancel
Showing results for 
Search instead for 
Did you mean: 

Pls help! Some questions on a sample JSP page...

Former Member
0 Kudos

Hi, I would like to understand this sample JSP better (yetanother.jsp from the TemplateJSPDynPage.par file downloaded from "Getting Started Section" of PDK inside my EP6.0). I have inserted 4 questions and statements(that I hope you can verify as correct or not) inside the code that I hope you can answer, they are marked by <b>"*** ***"</b>. Thank you so much for your help !

Thanks again,

Baggett.

<b><!-- #1 *** *** 'tagLib' is the folder containing tag(hbj) that I will use, am I right? Also, where is this tag(hbj) located? I went to my taglib folder(<ProjectName>/dist/PORTAL-INF/taglib), but nothing is there. Is 'hbj' just a name I can create for the tag?--> </b>

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

<b><!-- #2 *** *** 'myBean' is the name I create for the bean or class(bean.TemplateJSPDynPageBean) that I will use, am I right? What is scope? A bean is just a java class. Do you know where the bean.TemplateJSPDynPageBean is located on my machine? --></b><jsp:useBean id="myBean" scope="application" class="bean.TemplateJSPDynPageBean" />

<hbj:content id="myContext" >

<hbj:page title="Yet Another Page">

<hbj:form>

<hbj:gridLayout>

<b><!-- #3 *** *** Can you please provide info on each of these elements below: hbj, gridLayoutCell, rowIndex, columnIndex, what they are or do, how are they related? --></b> <hbj:gridLayoutCell rowIndex="1" columnIndex="1">

<b><!-- #4 *** *** myTextView is an instance of textView, setText is a method inside textView java class, and getText is a method inside myBean(TemplateJSPDynPageBean class), am I right?--></b>

<hbj:textView id="myTextView">

<% myTextView.setText(myBean.getText()); %>

</hbj:textView>

</hbj:gridLayoutCell>

<hbj:gridLayoutCell rowIndex="2" columnIndex="1">

<hbj:button id="button"

text="Yet Another Button"

onClick="onYetAnotherStateButtonClicked"/>

</hbj:gridLayoutCell>

</hbj:gridLayout>

</hbj:form>

</hbj:page>

</hbj:content>

Message was edited by: Baggett Soran

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

find the answers/comments below:

>

> <b><!-- #1 *** *** 'tagLib' is the folder containing

> tag(hbj) that I will use, am I right? Also, where is

> this tag(hbj) located? I went to my taglib

> folder(<ProjectName>/dist/PORTAL-INF/taglib), but

> nothing is there. Is 'hbj' just a name I can create

> for the tag?--> </b>

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

>

the taglib attribute shows the URI (also can be referred to as the path) to the <b>hbj tag library</b> that you're using. Usually, you should find the JAR file that contain all the classes that the tag library consists of in the folder you mention. The "hbj" is the prefix you use to specify (in your JSP code) that you're are using a tag of the hbj tag library...

General info about tag libraries you can find <a href="http://help.sap.com/saphelp_nw04/helpdata/en/dd/9a7005444a2d478edcc986ef10dd52/frameset.htm">here</a>.

> <b><!-- #2 *** *** 'myBean' is the name I create for

> the bean or class(bean.TemplateJSPDynPageBean) that I

> will use, am I right?

Yes, you're right.

> What is scope?

In your case it it "application", which means it can be accessed by all pages of this application. Possible scopes are also page|request|session. For more info, see this page: http://help.sap.com/saphelp_nw04/helpdata/en/3a/ec20401fe52402e10000000a1550b0/frameset.htm

> A bean is just

> a java class. Do you know where the

> bean.TemplateJSPDynPageBean is located on my machine?

Depends on your application structure.

> --></b><jsp:useBean id="myBean" scope="application"

> class="bean.TemplateJSPDynPageBean" />

>

> <hbj:content id="myContext" >

> <hbj:page title="Yet Another Page">

> <hbj:form>

> <hbj:gridLayout>

>

> <b><!-- #3 *** *** Can you please provide info

> e info on each of these elements below: hbj,

> gridLayoutCell, rowIndex, columnIndex, what they are

> or do, how are they related? --></b>

> <hbj:gridLayoutCell rowIndex="1"

> dex="1" columnIndex="1">

>

See this page: http://help.sap.com/saphelp_nw04/helpdata/en/a4/2cff40e39ba854e10000000a1550b0/frameset.htm

> <b><!-- #4 *** *** myTextView is an instance of

> of textView, setText is a method inside textView java

> class, and getText is a method inside

> myBean(TemplateJSPDynPageBean class), am I

> right?--></b>

Yes, you're absolutely right.

> <hbj:textView id="myTextView">

> <% myTextView.setText(myBean.getText());

> .getText()); %>

>

> </hbj:textView>

> </hbj:gridLayoutCell>

> <hbj:gridLayoutCell rowIndex="2"

> ndex="2" columnIndex="1">

>

> <hbj:button id="button"

> text="Yet Another Button"

> onClick="onYetAnotherStateButtonClicked"/>

> </hbj:gridLayoutCell>

> </hbj:gridLayout>

> </hbj:form>

> </hbj:page>

> </hbj:content>

Hope that helps!

Former Member
0 Kudos

Hi Soran,

To get answer to your first question you can visit this link : http://help.sap.com/saphelp_nw04/helpdata/en/dd/9a7005444a2d478edcc986ef10dd52/content.htm

for second answer visit following link...

http://help.sap.com/saphelp_erp2004/helpdata/en/f9/561140d72dc442e10000000a1550b0/content.htm

Answer 3.

<hbj:gridLayoutCell rowIndex="1" columnIndex="1">

this statement refers to cell in first row and first column.

Answer 4.

myTextView is just id of that textView.

we need it during event handling.

I hope this will help you.

Get back if you have doubts.

Regards,

Narinder Hartala