| 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: 56223
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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
|
 |
 |
|
|
subject: Set JSP Value
|
|
|