| 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: 85
|
|
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: 56153
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56153
|
|
|
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: 3786
|
|
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: 56153
|
|
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.
|
 |
 |
|
|
subject: equal symbol expected
|
|
|