I have a JSP page 1 to addusers to the account.On submission of the form another JSP 2gets called and manipulates the parameters.If values are null i am returning an error message to the user.If values are not null i need to call a servlet which will run a backend script.

The thing here is to call the servlet on the condition if the values are not null.The JSP 2 should automatically trigger the servlet and pass the parameters contained in the JSP2 to the servlet on the condition if values are not null.

Is this possible?Can anyone direct me in the right path towards this?????

Thanks in advance

Recommended Answers

All 3 Replies

Why you are trying to inject second page that is obsolete there? If you want to be sure user entered values and these are of correct format use JavaScript/Ajax/jQuery to do on form validation and submit form only if conditions are fulfilled.

Why you are trying to inject second page that is obsolete there? If you want to be sure user entered values and these are of correct format use JavaScript/Ajax/jQuery to do on form validation and submit form only if conditions are fulfilled.

Thanks for the reply...

Could do that using the javascript..ONce after submitting the form i wish to avoid hard coding in the servlet so that i could do most of my manipulations in the JSP that is called as the result and that JSP will trigger the servlet automatically if it requires and returns back the result to another JSP which will do further processing ...

You are getting logic of Java web development in wrong way. JSP is just presentation layer that is supposed to collect and present data. It is servlet and classes associated with it that are "hard workers" and handle logic.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.