String « Error « JSP-Servlet Q&A

1. Error: String cannot be resolved to the type

While trying this code,it shows this error in the string line.

  String error = (String)request.getAttribute("error");
  if(error != null)

2. i am trying to run a shell script from jsp but i am getting Ljava.lang.string error

I have the code in this way:

<% Process p;
 String[] cmd =  "Z:\\walmart\\";

 try {    
   p = Runtime.getRuntime().exec(cmd);
   StringBuffer s = new ...

3. Compilation error when comparing two strings with startsWith

I am developing for google app engine with JSP. And I need to compare two strings by startsWith() method in String class. Here is the code I am working on.


4. Error : String not found

5. String[] error