Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:48:18+00:00 2026-05-23T10:48:18+00:00

I used the following code in JSP, to try and retrieve login id and

  • 0

I used the following code in JSP, to try and retrieve login id and password. For some reason, no value is being shown when I try to output the username value from the bean…What am I missing here?

Code for loginbean.jsp–

<%@ page language="Java" import="java.sql.*" %>  
<HTML> 
<HEAD><TITLE>DataBase Search</TITLE></HEAD>  
<BODY>
<jsp:useBean id="db" scope="session" class="logbean.LoginBean">
  <jsp:setProperty name="db" property="*" />

 </jsp:useBean>
<jsp:forward page="welcome.jsp">
  <jsp:param name="userName" value="<%=db.getUsername()%>" />
  <jsp:param name="password" value="<%=db.getPassword()%>" />
</jsp:forward> 
</body>
</html>

Code for LoginBean.java–

package logbean;
public class LoginBean {
  String userName="";
  String password="";
  public String getUsername() {
  return userName;
  }
  public void setUsername(String username) {
  this.userName = username;
  }
  public String getPassword() {
  return password;
  }
  public void setPassword(String password) {
 this.password = password;
  }
  }

Code for login.jsp–

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Taurus SEO - SEO Inspector</title>
--now there are some blocks of text -------
---code for some static blocks of text-----
---code for some static blocks of text-----
---code for some static blocks of text-----
<form name="loginform" method="post" action="welcome.jsp">
          <br><br>
           <h2>Login Authentication</h2>  <br/>

          <p/><label>User Name: <input type="text" name="username"></label>
                <p/><label>Password: <input type="password" name="password"></label>
                <p/><input type="submit" value="Login">
                <input type="reset">

          </form>
-----some more static blocks of text------
-----some more static blocks of text------
-----some more static blocks of text------

Finally, below is code for welcome.jsp–

<HTML>   
<HEAD><TITLE>Welcome</TITLE></HEAD>  
<BODY>
<br><br><br><br>
<table align="center" style="border:1px solid #000000;">
    <jsp:useBean id="db" class="logbean.LoginBean" scope="session"/> 

<h4> Just checking to see if text is being shown</h4>
 <h1>Welcome <b><%= db.getUsername()%></b></h1> 

</table>
 </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:48:19+00:00Added an answer on May 23, 2026 at 10:48 am

    Looks like you might be missing the jsp:setProperty tag in your welcome JSP (as that’s the one you’re posting to).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the following code to post a search value via an html button.
I used the following code: <script type=text/javascript> function validate() { if ((document.changepass.newpassword.value != '')
I have used following code for download some files from our internet. public class
I used following code, but it displays only 2 digit of ISO country name.
i have used following code to repeat a process creation/close iteratively dim vProcessInfo as
I have used following code to create a simple PDF file. It executes fine
I am trying to used following code but I am not getting good performance
I've used following code snippet for my activity in order to deal with orientation
I've used following code for parsing XML file in c++. http://www.codeproject.com/Articles/176236/Parsing-an-XML-file-in-a-C-C-program . Now I
I used following JS code to create equal height columns: var colHeight = Math.max($('.3columngallery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.