File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes equal symbol expected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "equal symbol expected" Watch "equal symbol expected" New topic
Author

equal symbol expected

sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
hello every one.. can you please help me to solve this??

my error is :
org.apache.jasper.JasperException: /jspdbase.jsp(1,17) equal symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:198)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:148)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:161)
org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:468)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:411)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:203)
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:118)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:307)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

and
my jsp file is:

jspdbase.jsp:
<%@ page import "java.sql.*" %>

<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sand?user=root&password=sandeep");
Statement st=con.createStatement();

ResultSet rs=st.executeQuery("select * from jntp");
while(rs.next())
{
int i=rs.getInt("id");
String j=rs.getString("name");
%>
<h1>id is : <%=i%></h1>
<h1>Name is : <%=j%></h1><br>
<% }
}catch(Exception e){e.printStackTrace();}
%>



Tarun Bolla
Ranch Hand

Joined: Jun 20, 2011
Posts: 89
Equal to sign is missing in this directive


PS : (In the future, please UseCodeTags.(⇐click)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

You should also not be putting Java code into a JSP. That is a bad practice that has been discredited for 10 years. Time to update your skills.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
new to jsp.. let me wrk with basics.. thats why i am trying these.. self preparation
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

Scriptlets are not "the basics". They have been replaced with the JSTL and EL in 2002. 10 years ago.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4467
    
    8

sandeep kumar thommandru wrote:new to jsp.. let me wrk with basics.. thats why i am trying these.. self preparation

If you're new to JSP, you've got the perfect opportunity to learn to do it properly without learning lots of bad habits.
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
Bear Bibeault wrote:Scriptlets are not "the basics". They have been replaced with the JSTL and EL in 2002. 10 years ago.


thanks for your advise..

my jsp topics..

1.Introduction to jsp
2.jsp api
3.scripting tags
4.ditective tags
5.implicit objects
6.standard action tags
7.expression language
8.JSTL
9.custom tags
10.MVC architecture..

i am at topic 5.. and very soon i will come to know about JSTL..
and then, i will find out the difference between this and that..
it is better to know that why the latter is more flexible than the former..??


thank you for all the solutions and advises..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

It's not more flexible. In fact, it's much more restrictive. And that's the point! It prevents you from doing things in the JSP that should be done in the controller and not be done in JSPs.

It's good to know that your curriculum will cover the correct techniques to use. Knowledge of scriptlets may be necessary to work on legacy code, but they should never be used in new pages.
 
Don't get me started about those stupid light bulbs.
 
subject: equal symbol expected