0% found this document useful (0 votes)
25 views2 pages

New Microsoft Office Word Document - 2

The document discusses server-side programming using Java servlets to validate a username and password on login. It provides code for a CheckServlet class that extends HttpServlet to get the username and password parameters from a request, create a Check object to validate them, and print a welcome or error message depending on the validation status returned. The Check class code is also shown to check if the username and password equal hardcoded values and return a status.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

New Microsoft Office Word Document - 2

The document discusses server-side programming using Java servlets to validate a username and password on login. It provides code for a CheckServlet class that extends HttpServlet to get the username and password parameters from a request, create a Check object to validate them, and print a welcome or error message depending on the validation status returned. The Check class code is also shown to check if the username and password equal hardcoded values and return a status.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

SERVER SIDE MAGIC

Bishwavusan Satapathy 5 Sem, IT Welcome to Second Page. Error htwl SorryEnter valid User name & Password
th

Check,Servlet.java : (useful code)


Import javax.servlet.*; Import javax.io.*; Import javax.servlet.http.*; Import java.long.*; Public class Check Servlet extends httpservlet { Public void to Get(Httpservlet-Request Req, Http Servlet-Response hes) Throws IO Exception,Servlet Exception { Print Writer out = res. get Writer () ; Res. Set Content Type ("text/html); String name = req. get Parameter (name); String pass = req. get Parameter (pass); Check obj = new Check (); Int status = obj. check up (name,pass); If (status = = 1) Out. Print fn (Welcome to second page.); If (status = = 0) Out. Print pn (Sorry.Enter valid username & password.); Out. Close ();

Check.java:(useful code)
Import java.lang.*; Public class check { Public int checkup (String n,S tring p) { If {n.equals Ignore Case (pannalal)) { If {p.equal Ignore Case (bisu)) { return 1; } } return 0; } } In day to day life,we are so familiar with Internet.It is helpful for techinical as well as non techinical person.Internet provides information about Game,News,Poltical,Entertenment,Research, Medicine etc. Internet is frequently accessed by

all around the world.As we know that internet is super high way of information.But technically it is just the inter action between client and server. Actually client is a software program (browse) or user.Server is a big program designed in aprogramming languase.Protocal makes the brize between client and server.Server always looks upen clients affernity. As a non-technical person,one can guess that somebody provides all responses to client everytime but it is not right.Server is a dedicated program whose work is to provide support or response to the client. In some website,where a registered user wants to go enter into his or her mail box or another page,user must login to the site.For that,user used to provide correct user named and password.If user will not give proper user name and password,server will not allow to the user to use the site. But how actually sever takes request and check authorization and provide support according to that ? For that we should have little bit idea about sever side programming.Some languages are there in programming,which can design server side program.java,.net,perl,etc are those languages. Let go through the technical part of design provided by servlet (server side component) of java. Valid of User name & password. Success. Htwl :

You might also like