hi I am working about a project.I was working with JBuilder2008 till last and my codes was true and my projefct whould work successfully.for today I have got to work with MyEclipse. and I have gote a problem: request.setCharacterEncoding("UTF-8"); has got a red line below 'setCharacterEncoding' and it has below problem message: The method setCharacterEncoding(String) is undifined for the type HttpServletRequest could you tell me what shall I do? tanks advance for helping me.
views:
23answers:
2I think that the problem is that your Eclipse is configured to use an older version of the servlet APIs; see this forum post. (Right at the end.) The method is certainly present in the Java Servlet 2.4 APIs.
(FWIW, I pick up my Java Servlet APIs via an explicit Maven dependency, so I'm not hostage to the default version implied by my IDE settings.)
Inside MyEclipse IDE, please add 'javaee.jar' in your Project's build-path. This will solve your mentioned error about "request.setCharacterEncoding("UTF-8") "
Usually, during run-time (within web-server container) this jar will be already in classpath. But during development inside IDE, you may face this compile time error.
You will find this JAR at path depending upon your installation path:For example,
C:\MyEclipse6.0\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_6.0.0.zmyeclipse60020070820\data\libraryset\EE_5