由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - what's wrong with this little jsp?
相关主题
请推荐一下RESTful WS Frameworksoa变成rest,大家公司在用哪个?
question regarding apache jersey and spring mvc 3请问高手:thrift 要通过什么连database 比如 mysql ?
Java Web Services Tutorial 这个是最新的吗?java SOAP比restful难学吗?
JAVA REST API入门有什么好的video tutorial吗?Help with Tomcat for Eclipse v1.03
Help on EJBGenTomcat JSP syntax error
Re: transfer files over InternetRe: Where's the book:"James Cooper, Java Design Patterns, A Tutorial,
error of unix redirecting command called by java[转载] how to manipulate video files by programming
求转行建议, 电脑培训建议Help! How to call the C functions in a java program?
相关话题的讨论汇总
话题: jsp话题: html
进入Java版参与讨论
1 (共1页)
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?

1 (共1页)
进入Java版参与讨论
相关主题
Help! How to call the C functions in a java program?Help on EJBGen
Please recommend a good Swing book?Re: transfer files over Internet
String和java.lang.String有区别吗?error of unix redirecting command called by java
JSP 可以handle action 吗?求转行建议, 电脑培训建议
请推荐一下RESTful WS Frameworksoa变成rest,大家公司在用哪个?
question regarding apache jersey and spring mvc 3请问高手:thrift 要通过什么连database 比如 mysql ?
Java Web Services Tutorial 这个是最新的吗?java SOAP比restful难学吗?
JAVA REST API入门有什么好的video tutorial吗?Help with Tomcat for Eclipse v1.03
相关话题的讨论汇总
话题: jsp话题: html