m******o 发帖数: 774 | 1 Guys, I'm playing with Spring 3.0 but this little jsp keeps getting an error
that I could not figure out:
<%@ page import="com.mcnz.spring.*, org.springframework.context.*, org.
springframework.web.context.support.*"
contentType="text/html; %>
<%
ApplicationContext beanFactory = WebApplicationContextUtils.
getRequiredWebApplicationContext(getServletContext());
ClickCounter counter = (ClickCounter)beanFactory.getBean("clickCounter",
ClickCounter.class);
String clickedButton = request.getParameter("command");
if (clickedButton != null) {
counter.setCount(counter.getCount()+1);
}
%>
Count: <%=counter.getCount()%>
It's a tutorial at this link:
http://www.theserverside.com/tutorial/How-to-Use-Spring-30-In-a
The error message I got under tomcat-6.0.29 is this:
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(6,70) equal symbol expected
line 6 is this one:
ClickCounter counter = (ClickCounter)beanFactory.getBean("clickCounter",
ClickCounter.class);
It does not make any sense to me. I appreciate any help. | l****3 发帖数: 8 | 2 looks like the contentType in page directive is missing a double quote at
end, and semicolon in contentType should be removed too. | m******o 发帖数: 774 | 3 Thanks a lot it worked.
That's why I dislike jsp, why the error message is not about the contentType
at all?
【在 l****3 的大作中提到】 : looks like the contentType in page directive is missing a double quote at : end, and semicolon in contentType should be removed too.
| a***n 发帖数: 584 | 4 I agree that JSP error message doesn't provide good line info.
Besides minimize the usage of scriptlets, maybe switch to a different front
end display mechanism.
What do you think about things like FreeMarker, or ajax with RESTful json.
contentType
【在 m******o 的大作中提到】 : Thanks a lot it worked. : That's why I dislike jsp, why the error message is not about the contentType : at all?
|
|