Results 1 to 8 of 8
Thread: get data from servlet to html
- 04-09-2008, 02:40 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 38
- Rep Power
- 0
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..
- 04-09-2008, 02:42 PM #2
Member
- Join Date
- Apr 2008
- Posts
- 91
- Rep Power
- 0
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?
- 04-09-2008, 02:45 PM #3
Member
- Join Date
- Apr 2008
- Posts
- 91
- Rep Power
- 0
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
- 04-09-2008, 02:45 PM #4
Member
- Join Date
- Apr 2008
- Posts
- 38
- Rep Power
- 0
..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.
- 04-09-2008, 02:47 PM #5
Member
- Join Date
- Apr 2008
- Posts
- 91
- Rep Power
- 0
Yes You Can. You Need To put the date in Httpsession, or Cookie
- 04-09-2008, 02:55 PM #6
Member
- Join Date
- Apr 2008
- Posts
- 38
- Rep Power
- 0
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?
- 04-09-2008, 02:58 PM #7
Member
- Join Date
- Apr 2008
- Posts
- 91
- Rep Power
- 0
Lema,
If you use dispatcher and not putting the data in session
then what is happening?
- 05-22-2008, 04:00 PM #8
Similar Threads
-
get data from html to servlet
By lema in forum Java ServletReplies: 66Last Post: 04-09-2008, 02:43 PM -
how to search xml file data based on the given keyword from html form?
By nicemothi in forum XMLReplies: 0Last Post: 04-04-2008, 09:36 AM -
Getting HTML form values in Servlet
By Java Tip in forum Java TipReplies: 0Last Post: 11-17-2007, 08:13 PM -
How to retrieve data from servlet
By valery in forum Java ServletReplies: 1Last Post: 08-06-2007, 08:25 PM -
how to upload a file along with html form data
By pranith in forum Java ServletReplies: 3Last Post: 07-30-2007, 02:33 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks