Jsp static import

Posted by folone on Stack Overflow See other posts from Stack Overflow or by folone
Published on 2010-04-27T00:54:09Z Indexed on 2010/04/27 1:03 UTC
Read the original article Hit count: 287

Filed under:
|

I've created a Spring Roo project. Everything looks fine. Now I want to add a form with a text input and a button to my index.jspx. This form will change a static field currentUser in my ToDo class. So I'm adding:

<form>
  <%@ page import="static com.mypack.domain.ToDo.*" %>
   <label for="_username_id">My name is:</label>
    <% currentUser = request.getParameter("username"); %>
             <input type="text"  id="username" name="username" maxlength="30" path="username" size="0" value="<%= currentUser %>"/>
             <input type="submit"/>
</form>

somewhere in the middle of it. And now it won't work:

This page contains the following errors:

error on line 6 at column 20: StartTag: invalid element name
Below is a rendering of the page up to the first error.

function readCookie(name) { var nameEQ = name + '='; var ca = document.cookie.split(';'); for(var i=0;i

If I comment the lines above, it works just fine. What is wrong? Is there a way to write a value to a static field of a class from a jsp page? How do I work around this?

© Stack Overflow or respective owner

Related posts about jsp

Related posts about spring-roo