Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Sunil Mohan Tiwari
compilation errors
0 Answer(s)      2 years and 8 months ago
Posted in : Servlet Interview Questions


package jsptube.tutorials.servletexample;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WelcomeServlet extends HttpServlet 
{

    @Override
    public void init(ServletConfig config) throws ServletException 
    {
        super.init(config);
    }


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException 
    {

        String name = request.getParameter("name");
        String welcomeMessage = "Welcome "+name;

        response.setContentType("text/html");

        PrintWriter out = response.getWriter();

        out.println("<html>");
        out.println("<head>");
        out.println("<title> A very simple servlet example</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>"+welcomeMessage+"</h1>");
        out.println("<a href="/servletExamples/pages/form.html">"+"Click here to go back to input page"+"</a>");
        out.println("</body>");
        out.println("</html>");
        out.close();

    }


public void destroy() {

}
} 




giving errors:

1)  WelcomeServlet.java:37: ')' expected

out.println("<a href="/servletExamples/pages/form.html">"+"Click here to go back to input page"+"</a>");                                        ^

2) WelcomeServlet.java:37: not a statement  

out.println("<a href="/servletExamples/pages/form.html">"+"Click here to go back to input page"+"</a>");
     ^

3)WelcomeServlet.java:37:';' expected    

out.println("<a href="/servletExamples/pages/form.html">"+"Click here to go back to input page"+"</a>");
            ^    


please tell me the reason. fast                           

Advertisement
View Answers

Related Tutorials/Questions & Answers:
compilation errors
compilation errors  package jsptube.tutorials.servletexample; import java.io.IOException; import java.io.PrintWriter; import...() { } } giving errors: 1) WelcomeServlet.java:37: ')' expected
compilation errors - Swing AWT
compilation errors  how to create a window with five textFields, five labels and three buttons
Advertisements
errors
that what the errors in above code
check for errors
check for errors  How can I check for errors
What is the errors?
What is the errors?  ) while ( c <= 5 ) { product *= c; ++c;   if ( gender == 1 ) cout << "Woman" << endl; else; cout << "Man" << endl;   Post the whole code
types of errors in php
types of errors in php  What are the different types of errors in php
Compiler errors in java
Compiler errors in java  Hi, I used GenerateRDF java file. Am getting errors when i run this code. I used command prompt only. getting errors as no package exist. i followed your instructions properly. Please help me out
Servlets errors in same page.
Servlets errors in same page.  How do I display errors list in the same page where a form field exists using servlets...........i.e. without using JSP? Please explain with a simple username password program
selectoptions errors in java script
selectoptions errors in java script  hi, in my web page when I select the color of the image it displays that particular color but when i again opt the select option it displays errors message. How do I rectify this problem
The errors tag
In this section, you will learn about the errors tag of the Spring form tag library
jsp errors - JSP-Servlet
jsp errors  Hi I got errors when running a jsp file I am giving the file. this is from rose india. I set the class path for 3 jar files i.e.... Now i am getting less errors compared to previous. But I am getting 2 errors
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
Java Program Errors
Java Program Errors  These are the 2 errors which I am getting when executing the java source code extracted from executable jar file The project was not built since its build path is incomplete. Cannot find the class file
Correct errors - Java Beginners
Correct errors  Identify and correct the errors in the following program: public java Method { public static method1(int n, m) { n += m; xMethod(3. 4); } public static int xMethod(int n) { if (n > 0) return 1
STRUTS2.0 Validation Errors
the previous field errors persist in the page. For eg:if i am not entering both
WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?
WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?  WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP
compilation fail
compilation fail  package jsptube.tutorials.servletexample; import javax.servlet.GenericServlet; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import java.io.IOException; import
java Compilation
java program compilation time following error is occur in my system Note
java Compilation
java program compilation time following error is occur in my system Note
java Compilation
java program compilation time following error is occur in my system Note
compilation error
compilation error  Hi my program below is not compiling,when I try to compile it i'm getting the error message "tool completed with exit code 1".The loop has to be at the end of the program can you help me. Blockquoteimport
Java errors when attempting the following.
Java errors when attempting the following.  Give the java errors in attempting the following : 1) performing division operation on string value. 2) redefining base class final method in derived class. 3) defining a method
Need urgent help with C++ errors!
Need urgent help with C++ errors!  hi, i'm new to C++ programming. this is my code... i'm using Turbo C++. It's showing so many errors!.. I...() { cout<<"Can somebody fix this?"; } the errors are listed as follows
date_get_last_errors
date_get_last_errors date_get_last_errors alias DateTime::getLastErrors function returns the warnings and errors while parsing a date/time string... about warnings and errors. Example: <?php $date = date_create('asdfasdf
remopving errors incore java programming
remopving errors incore java programming  sir error in program:-file does not contain class runnable program:- class MyRunnable implements Runnable{ public void run(){ System.out.println("Run"); } public
remopving errors incore java programming
remopving errors incore java programming  sir error in program:-file does not contain class runnable program:- class MyRunnable implements Runnable{ public void run(){ System.out.println("Run"); } public
remopving errors incore java programming
remopving errors incore java programming  sir error in program:-file does not contain class runnable program:- class MyRunnable implements Runnable{ public void run(){ System.out.println("Run"); } public
need to fix errors please help
need to fix errors please help  it does have 2 errors what should i fix? import java.io.*; class InputName static InputStreamReader reader = new InputStreamReader(system.in); static BufferedReader input = new BufferedReader
srvlet compilation error - JSP-Servlet
srvlet compilation error  while compiling a servlet, httpservlet class not found errors & many such class not are generated.   Hi Friend, It seems that compiler haven't found the servlet-api.jar file.So put
Advertisements
 

 

 

DMCA.com