> lol, you have getGoo() defined not getFoo().
A typo of the email. This was just a sample cutting away all
the other things I'm doing.
> Your JSP needs to create the new instance of Test ...
> <% Test test = new Test() %>
> Then you can do the rest of the JSP and it should work
Actually this is specificly what I need to avoid. I need to
have only one instance of test running for the during of the
time the server is up. The eventual end us of what I'm trying
to write is to track users who log into a service and let an
administrator log them out or be to simply be aware they are
there.
> What's your error message?
Don't get any... when I go to the jsp page it just ends where
my jsp begins. View source shows the html up to that point,
from there on out it fails to create any html.
>> -----Original Message-----
>> From: Arcady [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, May 04, 2001 12:31 PM
>> To: [EMAIL PROTECTED]
>> Subject: Passing a string from a JSP to a Java class and
back.
>>
>>
>> This is an ultra simple one I would guess.
>>
>> But for some reason I cannot get it to go...
>>
>>
>> I want to take a string of data and send it from the jsp
>> webpage over to a class.
>> Then have that class send it back to the webpage which
puts
>> it on the screen.
>>
>> In essense step one of a larger process.
>>
>> My JSP would be something like this:
>>
>> <% String hello="Hello World" %>
>> <% test.setFoo(hello); %>
>> <%=test.getFoo() %>
>>
>>
>> My java class would be:
>>
>> test.java :
>>
>> import java.util.*;
>>
>> public class test {
>>
>> static public String foo;
>> private test() {}
>> static public void setFoo(String t) {
>> foo = t;
>> }
>> static public String getGoo() {
>> return foo;
>> }
>> }
>>
>>
>> I assume I'm missing something very obvious here...
>> Oddly enough none of my books on JSP cover this topic.
>> They all cover more advanced things like putting and
>pulling
>> from SQL databases or whatever...
>> But nothing on this simple level of work.
>>
>> So...
>> What exactly do I need to do to get that String to go in
>and
>> come back out again? :)
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets