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




Have Programming Question? Ask it here!
 
 
 


Sunil Mohan Tiwari
compilation errors
0 Answer(s)      2 years and 6 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
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
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
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
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 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 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
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
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
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
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
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
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
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
Servlet compilation problem - Java Beginners
Servlet compilation problem  hi, m a beginner to servlet world... i m facing problem in servlet compilation problem.. i have set the classpath.... i m compiling my program frm c:\javac HelloWorld.java but m getting 6 errors
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
java compilation error - Java Beginners
java compilation error  Hello, I'm having problems with trying to correct 2 compiler errors. The code I'm having trouble with is listed below. It's flagging two errors for this one code. The first error says identifier
java compilation error - Applet
java compilation error  I am getting compilation error in the following code.: public void paint(Graphics g) { switch(screen) { case 0: g.drawString(line1,2,10); break; case 1
java compilation error - Hibernate
java compilation error  hi i am getting org.hibernate.exception.GenericJDBCException: Cannot open connection exception when runnig the code why this exception is coming
java compilation error - JSP-Servlet
java compilation error  sir ,i have jdk1.6.0_01 and textpad installed .I have also set classpath and path.But stil on compiling my servlet programs in textpad i get compile time errors like javax.servlet.* ,javax.servlet.http.
Runtime Errors
Runtime Errors          Errors are arised when there is any logic problem with the logic of the program.  In this program we are trying
groovy compilation error - Framework
groovy compilation error  while i am running the grails application , i got the error message like: [groovyc...] [groovyc] 1 error Compilation error: Compilation Failed how we can resolve
Getting 404 errors - Java Beginners
I received a 404 errors and I identified that the servlet doesn't appear
Help please, some strange errors
this errors so i have posted the whole program here. Here i tried to make the monopoly... is causing that run-time errors? Any kind of help will be helpful to me. and let
Webshpere compilation error
Webshpere compilation error   I want clear result . Thank you WSWS3166E: Error: No client transport named 'http' found. faultActor: null faultDetail: [10/5/10 13:19:40:937 EDT] 00000043 SystemOut O WSWS3166E: Error
jdbc compilation error - JDBC
jdbc compilation error  java.lang.Exception: Problem in call_select when i am executing the program i am getting the above error. how can i resolve it?  Hi friend, plz specify in detail and send me code
Java compilation error - Java Beginners
Java compilation error  Method overridden problems in compile time error
java compilation error,Struts2 - Struts
java compilation error,Struts2  hi, From last 3 days i m trying for image uploading through struts2 by taking the reference of file upload sample code from roseindia.net site,But i m unable to insert it into database,its
java compilation error - Applet
java compilation error  hi friends the following is the awt front design program error, give me the replay E:\ramesh>javac product.java Note: product.java uses or overrides a deprecated API. Note
Java Compilation error - SQL
Java Compilation error  ava.lang.NullPointerException at beanUtils.SaleHeaderUtility.getFullRemainPatientList(SaleHeaderUtility.java:754) at forms.ProcessDialog.updatePatientBalances(ProcessDialog.java:119
compilation error - Java Beginners
compilation error  Dear sir, When i compile some pgms i am getting below error.what may be the reason? "uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details."  Hi Friend
java compilation error - Ant
java compilation error  hi, i have a application in which i m reading from an xml file and then storing its values in database.but when i started using ant its main program is not running as it is unable to detect the jar file
java compilation error - Hibernate
java compilation error  hi, i have made an registration page whosevalues should be inserted into database. i have used hibernate and eclipse it is working fine. but when i make a war file and deploy it using ant and then run
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can anyone help me to run the program in command line prompt i tried by selecting the environment variable and class path and path in my system my program
Advertisements
 

 

 

DMCA.com