• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying JSP in certain DIV tag

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic