cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing user input data from multiple external jsp includes

Former Member
0 Kudos

Hi all,

As my jsp page is becoming a long file, due to 64kb method limit the jsp page is giving java.lang.VerifyError during jsp compilation. Due to this reason i have split the jsp page into 3 seperate jsp pages and included them using action tags. All these three page will be having their own <hbj:content id="a1PageContext" ><hbj:form id="form1" >... hbj:content id="a2PageContext" ><hbj:form id="form2" >...hbj:content id="a3PageContext" ><hbj:form id="form3" >.

Now when i click a button in the 3rd jsp page , in the pageprocessor, i could able to access the controls within the current(3rd) jsp page only using method

InputField inputFld = (InputField)this.getComponentForId("input1");

It is giving null for controls of jsp page1 & 2.

How cxan i access these controls data in the jspGynpage.

Your help is highly appreciable.

Thanks & Regards

Markandeya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

we had the same problem, and maybe our solution will help :

our page contained a main tab strip with 5 items (tabs).

we broke the large JSP to 5 smaller JSPs the following way :

JSP1:

<some general code>

<tab>

<item1 title>

<item code>

<item2 title>

<item3 title>

<item4 title>

<item5 title>

JSP2:

<some general code>

<tab>

<item1 title>

<item2 title>

<item code>

<item3 title>

<item4 title>

<item5 title>

JSP3:

<some general code>

<tab>

<item1 title>

<item2 title>

<item3 title>

<item code>

<item4 title>

<item5 title>

JSP4:

<some general code>

<tab>

<item1 title>

<item2 title>

<item3 title>

<item4 title>

<item code>

<item5 title>

JSP5:

<some general code>

<tab>

<item1 title>

<item2 title>

<item3 title>

<item4 title>

<item5 title>

<item code>

This way, each of the 5 JSPs is significantly smaller than the original one we had, thus avoiding approaching the 64k limit.

We were able to do it thanks to the fact that our user does not HAVE to see all fields at the same time.

I hope this helps

zach

Former Member
0 Kudos

Hi Zach,

I have implemented the same idea couple of days back, which solved the 64k problem.

Really good to see the same idea.

Bu still i am facing jsp loading time considerbly high in comparision to external jsps.

Thanks & Regards

Markandeya

Former Member
0 Kudos

I did face similar problem, with different circumstances,

though. What I did and which worked is ---

--Create a JSP file with all HTMLB tags and some dynamic

include action tags, like <%@include file="xxx.jsp" %>.

This JSP page will have content, page, form etc. tags

beginning along with their closing end too.

--Create the xxx.jsp, yyy.jsp files which simply have

normal HTMLB tags, NO content, page, form tags. In these

pages you can make use of Java/JSP object references

from the enclosing JSP page, since this page runs in the

same context as the enclosing page.

Now you have separated a big JSP page in to several small

JSP pages.

I am not sure whether this answers your problem though,

Prasad

Former Member
0 Kudos

Dear Prasad,

The solution you are splitting the jsp pages in this approach is static include using <%@include file="xxx.jsp" %>. At the time of compilation main jsp will includes all its child jsps in a single jsp/servelet. This approach we can not avoid 64K problem.

Dymnamic include using action tag <jsp:include />

Will not incude the child jsps in Master jsp but runs as

separate/external servlet. (this will reduce code content of single jsp).

If u have any solution with Dymnamic include , pl let me know.

Regards

Markandeya

Former Member
0 Kudos

The id you give a htmlb element, is not the same which it uses in the create html. Therefore javascripts wont work.

See http://devnetmedia.sap.com/html/submitted_docs/htmlbManuals/javascriptapi_dev.html for more info.

One of the things taking up alot of space is the htmlb layout elements. If this is the reason you have such a big file you should considere using tables instead

Former Member
0 Kudos

Thank you for giving such helpful link. This link certainly helpful to me while client side access.

Now my problem is how to access all these controls in the server(Processor). I am able to access controls within the same form/jsp page from which event(button click) is generated.

I am not using htmlb layouts, page contains tabstrips, tableviews.

Now my problem is how to access all these controls in the server(Processor).

Thanks

Markandeya

Former Member
0 Kudos

Well, when you are using using multiple forms on a page, then only one of them will be posted.

Therfore, you cannot access all of the elements on the page from your server component.

You could "hack-it-up" by adding hidden inputfields to all forms which keep the information from the other forms (and their value is updated by javascripting). But this is not a good solution.

Think you need to redesign the screen flow, or find some new way of having several jsp's on one page

Former Member
0 Kudos

Thank you,

The hidden fields concept seems to be good idea. But i am having lot of fields and tracking them using javascript on each event may be tedious.

From the http request/ any other way to access all fields..

Instead of jsp action includes, if i use jsp static includes then also the 64 kb problem is coming.

If no solution, then i need to redisgn the screen

Thanks & Regards

Markandeya

Former Member
0 Kudos

No, the http request only contains the fields from the form that was submitted