Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Hi frnds iam new to Java Kindy any one can provide or me
Servlets Example code and can explain to me flow of servlets
and as Jsp and Struts and provide to me some sample example
on these 3 topic flow,code example,and tutorials,and related
websites which i can refer....thanks in advance..........

Answers were Sorted based on User's Feedback



Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to ..

Answer / tej kumar

Hai Friend...
As you are new to Java World.
For tutorials on Java, go through roseindia.net.
Good Luck..Bye

Is This Answer Correct ?    7 Yes 1 No

Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to ..

Answer / sarang

hi friend,this is sarang
following is the code for sevlet,i used net beans editor....

package javas;

import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class emp extends HttpServlet
{
public void init(ServletConfig config)throws
ServletException
{
super.config();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
}
catch(Exception e)
{
throw Exception(e.gerMessage())
}
}
public void doGet(HttpServletRequst
req,HttpServletResponse res)
throws IOException,ServletException
{
String pass=req.getParameter("password");
res.setContentType("text/html");
PrintWriter out=res.getWriter();

out.println("<html>");
out.println("<head>");
out.println("</head>");
out.println("<body>");
Connection con=null;
try
{
con=DriverManager.getConnection();
}
catch(SQL Exception e)
{
throw Exception("SQL Exception"+e.getMessage());
}
Statement stmt=null;
ResultSet rs=null;

try{
stmt=con.CreateStatement();
rs=stmt.executeQuery("select password,uname from t1
where pass=admin");

if(pass=="admin");
pw.println("welcome");
else
pw.println("try again!!!");


pw.println("</body>");
pw.println("</html>");
}
catch(Exception e)
{
out.println("Exception is"+e.gerMessage());
}
out.close();
}

Is This Answer Correct ?    2 Yes 0 No

Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to ..

Answer / praveen

hi please follow roseindia.net and if possible follow all lectures in youtube there are many IITKGP and many...all the best

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Servlets Interview Questions

What is called servlet container?

0 Answers  


what is the difference between ServletContext and ServletConfig

7 Answers  


Which java framework is most popular?

0 Answers  


What is http servlet?

0 Answers  


What is DSN and System DSN and what is the difference between them?

2 Answers  


What happens, when client requests for server object, which is not yet loaded into the memory?

2 Answers  


What do you mean by scope object and what are its types?

0 Answers  


What is cookie in servlet?

0 Answers  


Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to me flow of servlets and as Jsp and Struts and provide to me some sample example on these 3 topic flow,code example,and tutorials,and related websites which i can refer....thanks in advance..........

3 Answers  


How do you track a user session in servlets?

3 Answers  


i am bca student,give me suggest for bright future

18 Answers   BSNL, Future Considerations,


Why do you use session tracking in httpservlet?

0 Answers  


Categories