Win a copy of Terraform in Action this week in the Cloud forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Displaying JSP in certain DIV tag

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 valign="bottom">
<td><p class="text-login">Password:</p></td>
<td> </td>
<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>
<!-- end login section -->

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

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.

good luck
[ November 24, 2006: Message edited by: Hongli Li ]
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic