Re: Call another jsp page
Hi,
Quote:
I am a beginner in this field. I created a JSP with NetBeans with buttons and want to know how to click on a button, call another JSP page. I have tried it, but I am not getting the desired output, so can you guys please help me.
If I am not wrong in javascript it takes a line to do this job, just see the below code line and try it
Code:
onclick ="document.location.href = 'test.jsp'
Hope you understand it and start creating your new program.
Re: Call another jsp page
Hello
Quote:
If I am not wrong in javascript it takes a line to do this job, just see the below code line and try it
onclick ="document.location.href = 'test.jsp'
It works my friend. Thank you a lot. I will now try from this page, to call a servlet. I have not called a servlet from an jsp page before, hope this works for me. Though, i do not think this is going to be much difficult to do it. I'll keep you posted if I do have a problem in doing that.
Re: Call another jsp page
Hey guys
Even i have an similar kind of a problem. I'll explain what I do to develop a web application:
1) I created an index.jsp page with buttons for the main menu of my application.
2) From this interface and clicking a button, it should redirect me to another jsp page which also contains buttons CRUD (add, edit and delete).
3) By clicking for example on the Add button, I redirect to a servlet which should normally contain text fields for entering information.
4) By clicking on the Send button, there must access the DB to record in the table (I have DAO classes to handle CRUD operations).
Is what I am in the right direction?. Call the servlet is the same principle that since it is a JSP file in Java. Help me please.
Re: Call another jsp page
Hi
Quote:
" 1) I created an index.jsp page with buttons for the main menu of my application.
2) From this interface and clicking a button, it should redirect me to another jsp page which also contains buttons CRUD (add, edit and delete).
3) By clicking for example on the Add button, I redirect to a servlet which should normally contain text fields for entering information. "
I think we should apply the concept of MVC (model, view = jsp in your case, control), ie displaying jsp must be controlled, too, this is not the servlet that s 'but displays the jsp.
Re: Call another jsp page
Hi
Totally agree, if you want your web application more organized you should apply the MVC pattern, this way you will be less lost between all the different files. For example entering your form should be in a jsp page that it returns the results to a servlet that performs the desired processing and returns the results to a JSP page for display.