# how to get a field content  inside -  jsp page

**URL:** <https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [August 17, 2008, 10:13pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787 "2008-08-17T22:13:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gidonb](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@gidonb](https://techcommunity.softwareag.com/u/gidonb)\
**Post date:** [August 17, 2008, 10:13pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/1 "2008-08-17T22:13:52Z")

</div>

hi

how can i get a field content inside “jsp page”

An exaple from old framework

“”

how it’s work now ??

thank you

Gideon

---

<div class="post-metadata">

**Author:** ![Asaf\_Shak](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Asaf\_Shak](https://techcommunity.softwareag.com/u/Asaf_Shak)\
**Post date:** [August 18, 2008, 1:15pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/2 "2008-08-18T13:15:30Z")

</div>

Hi Gidon,  
You are talking about the methodology of the old JSP framework but now Applinx is working differently.  
The methodology of the new JSP framework is to get the screen properties like field content in the code behind (java class) and to bind the value with the JSP side.  
If you like to do some logic against the field content like display or remove some area in the JSP page, you should wrap the area with

---

<div class="post-metadata">

**Author:** ![gidonb](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@gidonb](https://techcommunity.softwareag.com/u/gidonb)\
**Post date:** [August 18, 2008, 2:34pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/3 "2008-08-18T14:34:59Z")

</div>

תודה רבה

---

<div class="post-metadata">

**Author:** ![Pascal\_W](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pascal\_W](https://techcommunity.softwareag.com/u/Pascal_W)\
**Post date:** [November 28, 2011, 6:13pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/4 "2011-11-28T18:13:26Z")

</div>

hi,

sorry to dig up this topic, but i can’t find the best way to retreive in my jsp data coming from the back ground screen.

i found something, but i don’t know if it’s a good way.

in the java class associated with the jsp (gx\_onInit() method) i put a link to “GXScreenBasedJspContext.getGXForm()” into request attribute.  
getRequest().setAttribute(“GXForm”, getGXForm());

in the jsp i declare  
\<%!  
public String gxField(GXScreenBasedJspContext gxForm, String field) {  
String fieldValue=null;  
try {  
fieldValue=gxForm.getAppFieldContent(field);  
} catch (com.sabratec.applinx.baseobject.GXGeneralException e) {   
}  
return (fieldValue==null)?“”:fieldValue;  
}  
%\>  
\<% GXScreenBasedJspContext gx=(GXScreenBasedJspContext)request.getAttribute(“GXForm”); %\>

then i do \<%=gxField(gx,“EMAIL”)%\> to have the email data which was previously identified in the background screen

Is there a problem when doing do  
Is there a better way to do that ?  
You spoke about methodology for old JSP framework… Which is the new methodology ?

thanks for your help

---

<div class="post-metadata">

**Author:** ![Ohad\_M](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@Ohad\_M](https://techcommunity.softwareag.com/u/Ohad_M)\
**Post date:** [November 29, 2011, 12:47pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/5 "2011-11-29T12:47:42Z")

</div>

Hi Pascal,

The new methodology is having all you server-side (JAVA) code in the java class associated with the JSP file.

In addition, host screen data can be easily retrieved by defining the field in the screen entity and then on the JSP Page placing either a gx:span... or gx:input... with an ID attribute value that is exactly the same as the name of the field in the Screen entity.

example: \<gx:span id=“Email”\>\</gx:span\>

When the host gets to this particular screen (lets call it screenX) the web application will automatically load screenX.jsp and fill it the SPAN with the appropriate host content.

Hope this helps,  
regards,  
Ohad

---

<div class="post-metadata">

**Author:** ![Pascal\_W](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pascal\_W](https://techcommunity.softwareag.com/u/Pascal_W)\
**Post date:** [November 29, 2011, 1:04pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/6 "2011-11-29T13:04:41Z")

</div>

Hi Ohad M.,

Thanks for your respons.

In fact, i want a link to the email, so i do this:

\<a href=“mailto:\<%=gxField(gx,“EMAIL”)%\>”\>  
\<gx:span id=“EMAIL” cssClass=“gx\_uf”\>\</gx:span\>

Method “gxField” explained previously.

Is there a beter way to do that ? It should be great to have a tag that could do that.

best regards

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:50pm UTC](https://techcommunity.softwareag.com/t/how-to-get-a-field-content-inside-jsp-page/78787/7 "2021-04-02T14:50:46Z")

</div>


