aspose file tools*
The moose likes JSP and the fly likes Set JSP Value    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Set JSP Value    " Watch "Set JSP Value    " New topic
Author

Set JSP Value

Arthur Buliva
Ranch Hand

Joined: Mar 08, 2006
Posts: 101
I have a two jsp pages. One returns values as appropriate. The other sets a variable in itself by calling the first one and reading the value it returns. This is what I mean:





And another page skeleton,




Any ideas? Thanks in advance.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Look up the <jsp:include .../> action.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Arthur Buliva
Ranch Hand

Joined: Mar 08, 2006
Posts: 101


Is what I have on my <head>

How then do I call on time.jsp to deliver the appropriate String?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

JSPs are not methods that you "call". Perhaps you should back up a bit and explain what you're trying to accomplish. You may be barking up the wrong tree.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Arthur Buliva
Ranch Hand

Joined: Mar 08, 2006
Posts: 101
I have many jsp pages, each returning things according to its code. However, I have another page that needs the same data, but in one form. So I thought I could get the data by running each of the other pages separately and retrieve the results, instead of having all the code on one page. This is what I mean:

time.jsp displays only the time
ip.jsp displays the next available ip
updateip.jsp > gets the date and the next available ip. This is where I was thinking; instead of replecating time.jsp and ip.jsp functions in updateip.jsp, why not ask time.jsp for the time and ip.jsp for the ip as needed?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Includes are still very useful in JSP but there are better approaches to re-using code than this.

This article by our esteemed sheriff Bear Bibeault explains why and how MVC and scriptless JSP pages work better.
http://www.javaranch.com/journal/200603/Journal200603.jsp#a5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Set JSP Value