Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Call another jsp page

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 12-01-2010
Member
 
Join Date: Dec 2009
Posts: 292
Call another jsp page
  

Hello
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. An example will be appreciated. Thank you.


Last edited by Miles Runner : 12-01-2010 at 09:09 AM.
Reply With Quote
  #2  
Old 12-01-2010
Member
 
Join Date: Apr 2008
Posts: 2,000
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.
Reply With Quote
  #3  
Old 12-01-2010
Member
 
Join Date: Dec 2009
Posts: 292
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.
Reply With Quote
  #4  
Old 12-01-2010
Member
 
Join Date: Dec 2009
Posts: 202
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.
Reply With Quote
  #5  
Old 12-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
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.
Reply With Quote
  #6  
Old 12-01-2010
Member
 
Join Date: May 2008
Posts: 2,382
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.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Call another jsp page"
Thread Thread Starter Forum Replies Last Post
Firefox 15 page loading is very slow when opening modem page Thomas Hewitt Technology & Internet 2 10-09-2012 10:48 AM
Call entry stuck in Nokia C3-00 call log and stopped call logging Elijah*Blue Portable Devices 14 09-04-2012 02:49 PM
IE 9 is displaying blank page and showing links as mouse hovered on the page Chitti's Technology & Internet 10 03-12-2011 09:31 AM
How can I get speed dial page as default page in Google Chrome v13 ? Shurod Technology & Internet 6 12-09-2011 10:47 PM
Getting “Page cannot be displayed” error message while loading page on Internet Explorer 9 Nabhan Technology & Internet 9 26-08-2011 11:44 AM


All times are GMT +5.5. The time now is 05:59 AM.