cancel
Showing results for 
Search instead for 
Did you mean: 

NWDS - JSP & Java

Former Member
0 Kudos

Experts,

THis is for CRM. I have a button called 'Go' in JSP (developed using NWDS)

1. When I click on the button, how can I capture the events?

2. After clicking on the event, I need to call the Java class to perform some backend activity. Pls guide me how?

3. After this, goto next page called result.jsp.

I've gone thro, "Development and Extension Guide u2013 SAP E-Commerce 7.0", but I dont understand how to intergrate the JSP & actions.

Please advise with steps & code..Appreciate your help..

BM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello there,

The simplest way I would recommend will be create a web module project in NWDS.[File ->New Web Module Project]

Create 2 JSP pages in the webproject[ A.jsp and B.jsp]

The first JSP page will have tags like this.

<body>

<form action="B.jsp">

<button >Submit </button>

</form> </body>

Once the Submit button is submitted the execution goes to the 2nd JSP page as provied as submit.jsp here.

In the second JSP page you can read the parameters from first page and perform the Java Operation. Also you can make use of Java Beans for the back end call. After this you can forward it to a another page.

Java Beans with code sampe [Removed by the moderator.]

Also check this for the entire set of JSP examples [Removed by the moderator.]

Let me know if you need any further information

Regards,

Vivek

Former Member
0 Kudos

Thanks for the reply...But I might have another button called "Validate". With your code the action will posted always to next page.

So how can I distinguish the events from 2 different buttons?

Raja

Former Member
0 Kudos

Please find my next post

Former Member
0 Kudos

Hi,

Basically you need to have a hidden form field on click on button using javascipt assign some values to the hidden form field.

Next when you submit the page. The JSP using request.getparameter can find out which value the form field has and thus conclude which button was pressed.

Former Member
0 Kudos

Thanks, Do you have sample code please?

BM

Former Member
0 Kudos

Hello there,

I am unble to paste the code, something wrong with JLive.

But I have typed the code in my eclipse and tested it. I have taken screen shot of the code and posted it here.

[Removed by the moderator.]

Let me know if you need any more informations

Regards,

Vivek Nidhi.

Former Member
0 Kudos

Thanks I can expand & view only one screen print & icant expand the 2nd screen..

BM

Former Member
0 Kudos

Hello there,

The second JSP page should only have this

<%=request.getParameter("Language")%> <br></br>

<a href="index.jsp"> Back to Front Page</a>

0 Kudos

Hi guys. Could you repost that code samples please. or drop me a mail.

Thanks in advance.

Answers (0)