cancel
Showing results for 
Search instead for 
Did you mean: 

JSP to Java Call using <% .. %> in same file ( jsp )

Former Member
0 Kudos

Hi

I modified the iHeader View JSP file in the Masthead PAR file.

I have an issue.

The issue at the moment i think is a minor code syntax , is that JSP is not able to communicate user events, to the Java in the same JSP file ,

I am using "<% %>" directives inside the jsp code to call java function ( which updates users choice ), the problem is that the code inside these directives to call the java function are not abiding by the if then condition of JSP, therefore other JSP codes ( like alert... etc ) are abiding by the jsp if then condition, but not the code in these directives. They are called in sequence , irrespective of the if then condition.

Here's the code below -

"

var r=confir..("I Here By Accept Terms and Conditions, by pressing the OK button below.");

var uni = 'dummy';

if(r==true)

{

uni = '<%=setAccUser(componentRequest, "Y")%>';

aler...("Thanks for accepting, Welcome to the Portal.");

}

else

{

uni = '<%=setAccUser(componentRequest, "N")%>';

aler...("You'll be now logged off , from the Supplier Portal. To view the Terms and conditions , please visit the link on the log on page.");

}

"

So for the above code , the parameter .... (..., "N ") ... will be sent always, irrespective of user selection.

Tried the above <%java call%> ( independently ) by using simple buttons ( instead of confirm box and if then conditions ) .. with same results.

As the <%Java call%> does not abide by the JSP code.

The code <%Java call%> among JSP is always called in sequence, irrespective of any user inputs.

How can we make <%Java function call%> to abide by the JSP if then condition, also as an alternative how can i pass user entry ( html ) to Java via JSP or directly to java function ( all with in a same jsp file ).

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Your code does not run as you want. You have post something or use AJAX for this.