Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

JSP Question

Thread view: 
Liquidchild - 02 Nov 2005 10:22 GMT
Not sure if this is the correct group, but...

I have the following jsp page, basically i want to append some text to
the username before the form is submitted, is this possible?

Thanks

S.

<HTML>
<HEAD>

<STYLE type=text/css>

A
{
    FONT-SIZE: 10px;
    COLOR: #000000;
    FONT-STYLE: normal;
    FONT-FAMILY: Arial, Helvetica, sans-serif;
    TEXT-DECORATION: none
}

A:HOVER
{
    color:#E600B3
}

</STYLE>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
</HEAD>

  <%
   String loginid = (String) session.getAttribute("loginid");
  %>

  <%

    String errormsg = "";
    int errorcode = Integer.parseInt(request.getParameter("errorcode"));

    switch( errorcode )
    {
         case -1:
        case -4:
        case -5:
        case -6:
        case -7:
          errormsg = "LDAP login failed";
           break;
         case -2:
           errormsg = "Username not found";
           break;
         case -3:
           errormsg = "Password Incorrect";
           break;
         case -8:
           errormsg = "About to lock account";
           break;
         case -9:
           errormsg = "Account locked";
           break;
        case -10:
           errormsg = "Password Format Invalid";
           break;
         case -11:
           errormsg = "Session expired";
           break;
         case -12:
           errormsg = "General Error";
           break;
         case -13:
           errormsg = "No Cookie";
           break;
       }
  %>

<BODY bgcolor="#ffffff">
<FORM action="" method="post" name="Sales Login" target="_parent">
<%=errormsg%>
    <TABLE width="100%" cellpadding="0" cellspacing="0"
class="services_bodypurp3">
        <TR class="services_bodypurp3">
            <TD width="30%">
                <B>Username</B>
            </TD>
            <TD colspan="2">
                <INPUT name="Username" type="text" maxlength="200" size="30">
            </TD>
        </TR>
        <TR class="services_bodypurp3">
            <TD>
                <B>Password</B>
            </TD>
            <TD colspan="2">
                <INPUT name="UserPassword" type="password" maxlength="1024"
size="20">
            </TD>
        </TR>
        <TR class="services_bodypurp">
            <TD>
                &nbsp
            </TD>
            <TD>
                <INPUT type="hidden" name="loginid" value="<%=loginid%>"/>
                <INPUT name="Submit" title="Login" type="submit" value="Login">
            </TD>
        </TR>
    </TABLE>
</FORM>
</BODY>
</HTML>
blueoxygen - 04 Nov 2005 02:34 GMT
Your form's action attribute is action="",so the jsp itself will
process the request.But where is your logic codes to generate
errorcode?
You should have a servlet to response this request and then set a
servelt filter to do the validation thing.
Such as generate errorcode.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.