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 8025877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:18:35+00:00 2026-06-04T23:18:35+00:00

I have a login.jsp page: <form method=post action=url:8081/login.xhtml> Username : <input type=text name=txtUsername/> Password

  • 0

I have a login.jsp page:

<form method="post" action="url:8081/login.xhtml">
    Username : <input type="text" name="txtUsername"/>
    Password : <input type="text" name="txtPassword"/>
    <input type="submit" value="submit"/>
</form>

When I submit it, how can I get the txtUsername and txtPassword parameters in login.xhtml?

  • 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-06-04T23:18:37+00:00Added an answer on June 4, 2026 at 11:18 pm

    All request parameters are in EL available by the #{param} map. Thus, this should do:

    <p>Username: #{param.txtUsername}</p>
    <p>Password: #{param.txtPassword}</p>
    

    If you need to preprocess them by Java code, better put them as managed properties or view parameters in the backing bean class associated with login.xhtml.

    Managed property example:

    @ManagedBean
    @RequestScoped
    public class Login {
    
        @ManagedProperty("#{param.txtUsername}")
        private String username;
    
        @ManagedProperty("#{param.txtPassword}")
        private String password;
    
        @PostConstruct
        public void init() {
            // Do here your thing with those parameters.
            System.out.println(username + ", " + password);
        }
    
        // ...
    }
    

    View parameter example:

    <f:metadata>
        <f:viewParam name="txtUsername" value="#{login.username}" required="true" />
        <f:viewParam name="txtPassword" value="#{login.password}" required="true" />
        <f:event type="preRenderView" listener="#{login.init}" />
    </f:metadata>
    

    with

    @ManagedBean
    @RequestScoped
    public class Login {
    
        private String username;
        private String password;
    
        public void init() {
            // Do here your thing with those parameters.
            System.out.println(username + ", " + password);
        }
    
        // ...
    }
    

    See also:

    • ViewParam vs @ManagedProperty(value = "#{param.id}")
    • Communication in JSF 2.0 – Processing GET request parameters
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login page with form action of j_security_check . As of now
I have a login.jsp page which contains a login form. Once logged in the
I have an https jsp page that takes login values (username/password) and validates the
Normally we have login page with username, password filed and signin button. Using the
I try to create login form in web application. in JSP page I can
I have a form on my .jsp page which sends a password back to
I am using Ajax in a jsp page wherein we have a form of
Title pretty much says it all. I have a page called login.jsp: <f:view> <html>
I have jsp file: <%@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8%> <%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core%>
I'm making a login page in JSP. I have an index.jsp page where the

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.