What happened to the JSP predefined variables in 10.5.2

The ide throws an error that the methods are undefined (in red) for request, application. Shouldn't I get them by default when I create a JSP?
I should have to add anything, turn something on.

Thanks for a reply.

Comment actions Permalink

Hi James,

Can you provide a small example?
Perhaps your module is missing the servlet-api or jsp-api library dependencies.


Comment actions Permalink

I have the servlet-api.jar from TC 6 in my project. I'm trying to move my development from Eclipse but it has no problems with the JSP predefines. I have a simple jsp did you want the project which I can zip its not that large you wont have my tables. I'm using MySql 5.1, I could include the scripts to build the DB. I'm also using Spring 3.0.5, Hibernate 3.

My jsp

Created by IntelliJ IDEA.
User: jlopes
Date: 9/4/11
Time: 8:36 AM
To change this template use File | Settings | File Templates.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<title>Home Page</title>
<h3 align="middle">Home Page</h3>
Skipped the index page and used the Home controller to jump to the Home page. Using these links to practice, each link has its own controller.
Implement security were?
<li><a href="annotatedmvc">Annotated MVC pages</a></li>
<li><a href="sqlpage">SQL, JDBC, Hibernate pages</a></li>
<li><a href="wspage">Web Services pages</a></li>
<li><a href="jquerypage">jQuery, Javascript pages</a></li>
<li><a href="javasixpage">Java 6 feature set pages</a></li>

Comment actions Permalink

Hi James,

The sample JSP page that you've provided does not seem to contain any reference to request or application.

If the project works fine, but is highlighted red by IDEA, it would make sense to submit a bug here:

Attaching a minimal sample project that demonstrates the problem (to the issue created in the bug database, not this forum discussion) would certainly help.

Comment actions Permalink

First thanks for the help.

Here's what I found I added the server libs as an External library and was able to 1. still build and run the simple project, 2. Add the jsp predefines to a jsp.
I did find some problems were I'm not getting the context path of the page which is the reason for going through all of this. I'll send the project to the issue site

Here is the code from the project
// returns the application context /TestJspPredefines not getting the path in the intelliJ project works fine in eclipse Indigo
System.out.println("the ContextPath " + pageContext.getServletContext().getContextPath());
// these work
request.setAttribute("fun", "time");
System.out.println("The value of Fun " + request.getAttribute("fun"));

Another problem is in the online doc "Setting up a project in intelliJ IDEA were it instructs the developer in how to add the jdk but doesn't mentiion adding the server libs.
I missed this ( for on I didn't read the doc when I started using the IDE ) used to using eclipse it adds the server lib in its wiz.

Now that I know more about the IDE I can investigate my real project, It appears to have done some funky things with Ajax to get the context path.

<script type="text/javascript" src="${pageContext.request.contextPath}/js/index.js"></script>

Have to back over the JDK 6 doc but I believe this is deprecated pageContext.request.


Please sign in to leave a comment.