Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying JSP in certain DIV tag  RSS feed

 
Vikram Bindal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am creating a web-site and in that I have different div tags for different sections. My one div tag comprises of login panel and what I want to do is that when the user clicks the login button, assuming authentication is done then I want to update the page only on that DIV tag which has a particular ID. How can I do this. ?

<!-- login section here -->
<div id="banner-sub">
<h2>SIGN IN </h2>
<table width="180" border="0" cellspacing="0">
<tr valign="bottom">
<td width="67"><p class="text-login">Username:</p></td>
<td width="109"> </td>
</tr>
<tr valign="bottom">
<td><p class="text-login">Password:</p></td>
<td> </td>
</tr>
</table>
<p class="login-buttons"><a href="Testing.jsp">sign in</a></p>
<p class="text-login-forgot"><a href="#">Forgotten your Username?</a></p>
<p class="text-login-forgot"><a href="#">Forgotten your Password?</a></p>
<p class="login-buttons"><a href="#">register</a></p>
</div>
<!-- end login section -->

And the code for my Testing.jsp (just a simple display showing "JSP Page" for now, JSP functionality added later on)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>

So basically, I want Welcome displayed in that div tag which has id "sub-banner". Help would gladly be appreciated. Thank you
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's something to do with Ajax, Jquery can do that, basically, you need a servlet to do the authentication, and the output of your doGet() or doPost() has to be html code(WELCOME) in order to put them in the sub_banner div. YOu can use javascript getElementByID or use Jquery build_in $("sub_banner") syntax to change the div's content. here is the link to Jquery. www.jquery.com

good luck
[ November 24, 2006: Message edited by: Hongli Li ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!