Jean Noel

+ Follow
since Nov 30, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jean Noel

Bear Bibeault wrote:If you are submitting to a servlet (as you should be -- a JSP should never be the target of a submission) you don't need all of that useBean crap in the JSP. Get rid of it.

In the servlet, you'll fetch the submitted data through the request.getParameter() family of methods on the request instance.

Well, I guess that if the value in the jsp need to be initialized, this has to happen in the bean, hasn't it?

I understand I can do a getParameter for each field, but it would be much more convenient if the bean members would get all populated at once... Would save me a lot of line of codes...

But thanks a lot for your help

6 years ago

I've been working for a long time with JSF, and now that I have to work with JSP/Servlets, I can't figure out how to perform basic things I was easily doing before.

Basically, I have a jsp that displays a form; the user types in data, and when submitting the form, a servlet is invoked to separate business logic from presentation.

In my jsp, I have included the bean:
<jsp:useBean id="expert" scope="session"
class="....Expert" />

I have tried adding:
<jsp:setProperty name="expert" property="*"/>

right below the bean declaration, without success.

I have declared the input field:
<input id="firstname" type="text" class="form-control"
placeholder="First name" value="${expert.firstName}" />

When clicking on 'submit', I would expect the servlet to find a session variable named 'expert' (which it does) with the value entered by the user in the fields.

Unfortunately, this does not work and fields in the servlet are always null.

I'm probably missing something here, but I'm running out of idea, so would appreciate some help... Am I trying to do something impossible?


6 years ago

I'm running JWSDP1.6 on Os X Tiger, but with Tomcat 5.0, not Tomcat 5.5.
Tomcat 5.5 is not a supported platform for JWSDP (unfortunately), and I could not find trace of someone who successfully installed it.

15 years ago