• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

equal symbol expected

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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();}
%>



 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Equal to sign is missing in this directive


PS : (In the future, please UseCodeTags.(⇐click)
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
sandeep kumar thommandru
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
new to jsp.. let me wrk with basics.. thats why i am trying these.. self preparation
 
Bear Bibeault
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scriptlets are not "the basics". They have been replaced with the JSTL and EL in 2002. 10 years ago.
 
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic