Hi Rajendra!
A jsp page is compiled to a servlet (to the purists: yes I know this is
not a must be the result nevertheless will behave as if)
so you have access to all the servlet stuff inside and so you can
access databases and whatever you like.
Here a (very!) short overview:
<% your-code-here %> whill be put in the service-method where
you have access to the vairbales request and response.
<%! your-methods-and-servlet-attributes-here %>
will but your code on the class level so you can define methods
and attributes.
<%= your-java-expression-here %> will allow you to insert the output
of java expressions into your html templeta text.
>Hi everybody,
> This mail is from a complete beginner in JSP. (for people who hate
>newbie quesitons).
>
> I want to create a form which will have a list of questions. The
>questions as well as the answers to it needs to be saved into the database.
>
> The way I have implemented it currently is - having JavaScript arrays
>which will have all the questions, call a servlet which will parse out the
>data and save it to the database. The parsing logic is becoming pretty ugly
>very soon as these questions itself have a lot of sub-sections. When I pass
>the data to the servlet (put it in a hidden field!), I store values in the
>array in a string and since I know how it is encoded, I decode the string in
>the servlet.
>
> I do not like the way I have implemented it. After exploring some
>options, I beleive JSP would be a good choice. I need some tips.hints here
>from you gurus...
>
>1 - Completely do away with the servlet. Have a jsp file which will have all
>the questions etc in variables. Use HTML to display the contents, then use
>SQL to save the data.
> The advantage here would be that I wouldn't need to do a lot of coding
>to encode/decode string values. Since I am in the jsp file itself, I have
>all the variables with me which I can directly save.
>
>Question : Can jsp do an update to the server database? Can anybody post me
>some code on how to declare variables, use them in html and access them
>again in SQL queries?
>
>I can elaborate more on my question if it is not clear.
>Any help would be appreciated.
>
>Thanks.
>Raaj.
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST"
.
>FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
Ciao,
Carsten Heyl
Carsten Heyl [EMAIL PROTECTED]
NADS - Solutions on Nets http://www.nads.de/
NADS GmbH http://www.pixelboxx.de/
Hildebrandtstr. 4E Tel.: +49 211 933 02-90
D-40215 Duesseldorf Fax.: +49 211 933 02-93
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html