Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-2008, 03:40 PM
Member
 
Join Date: Apr 2008
Posts: 38
lema is on a distinguished road
get data from servlet to html
hallo folk,

here is the thread from where this thread occured get data from html to servlet

the question is, after getting data (username, password) into servlet, and after checking the user's authorizatin in servlet through a server-side-mehtod, can i get an approval data (for example boolean b) back to jsp page. if (b) open application page, else error page..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-09-2008, 03:42 PM
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
I dont understand why jsp want to be a controller. See JSP Is Meant For

Only presenting the data. Your Logic Or Controller Part should be

handled by Servlet. Did you get it?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 03:45 PM
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
Hei Lema, In Servlet You create the RequestDispathcher Object.

Then Write Simple If Condition. If user exists forward him to exact page

else

error.jsp
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 03:45 PM
Member
 
Join Date: Apr 2008
Posts: 38
lema is on a distinguished road
..so it means i can't use any data from servlet in jsp, right. then i gotta get back to the old problem - opening applicatin page from servlet in the same browser.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 03:47 PM
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
Yes You Can. You Need To put the date in Httpsession, or Cookie
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 03:55 PM
Member
 
Join Date: Apr 2008
Posts: 38
lema is on a distinguished road
in httpSessin i save the the object User. and i save it after checking the user's authorization.
here is how i log in and send username&password to servlet

<table>
<tr>
<td>Username: </td>
<td align = "left" width="20"><input name="username" type="text" size="40"></input></td>
</tr>
<tr>
<td>Password: </td>
<td align = "left" width="20"><input name="password" type="password" size="40"></input></td>
</tr>
<tr><td>
<input type="submit" name="enter" value="Enter SMD"></input>
</td></tr>
</table>
</form>


the question is, how can i open the application page on same browser after checking the authorization? how? in jsp page through onClick, or in servlet through Dispatcher?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 03:58 PM
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
Lema,
If you use dispatcher and not putting the data in session

then what is happening?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-22-2008, 05:00 PM
freddieMaize's Avatar
Member
 
Join Date: Apr 2008
Location: Bangalore,India
Posts: 60
freddieMaize is on a distinguished road
Quote:
Originally Posted by javarishi View Post
Lema,
If you use dispatcher and not putting the data in session

then what is happening?
hi rishi,

I've the same problem.. i used requestdispacher but den too i was not able to get the values.. can u suggest??

regards
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
get data from html to servlet lema Java Servlet 66 04-09-2008 03:43 PM
how to search xml file data based on the given keyword from html form? nicemothi XML 0 04-04-2008 10:36 AM
Getting HTML form values in Servlet Java Tip Java Tips 0 11-17-2007 09:13 PM
How to retrieve data from servlet valery Java Servlet 1 08-06-2007 09:25 PM
how to upload a file along with html form data pranith Java Servlet 3 07-30-2007 03:33 AM


All times are GMT +3. The time now is 10:51 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org