One problem today is the spring tag and the JSP expression.
Directly on the code
<Form:formCommandName= "book"Action= "/book_update"Method= "POST"> <fieldset> <legend>Edit a book</legend> <Form:hiddenPath= "id"/> <P> <label for= "category">Category:</label> <Form:selectID= "category"Path= "Category.id"Items= "${categories}"Itemlabel= "Name"Itemvalue= "id"/> </P> <P> <label for= "title">Title:</label> <Form:inputID= "title"Path= "title"/> </P> <P> <label for= "Author">Author:</label> <Form:inputID= "Author"Path= "Author"/> </P> <P> <label for= "ISBN">Isbn:</label> <Form:inputID= "ISBN"Path= "ISBN"/> </P> <PID= "Buttons"> <inputID= "Reset"type= "Reset"TabIndex= "4"> <inputID= "Submit"type= "Submit"TabIndex= "5"value= "Update book"> </P> </fieldset></Form:form>
The problem is that in action= "/book_update" , this action will have a problem at the time of submission, think of the project's basepath, try to do it, but always report a mistake, that is%> Without the right end, the guess was that the code in the spring tag could not be inserted into the Java expression, and later checked to say that the spring tag is compatible with El, so write
Get BasePath
<%basepath= "..."%>
<c:url value= "<%=basepath%> var=" BasePath "/>
Write in action like this
Action= "/' ${basepath} ' Book_update"
This is OK, the core is to use the EL expression do not use the output expression
Add:
<%%> is called java Script (local variable)
<%=%> is called an output expression.
<%! %> is called a JSP declaration (equivalent to a global variable)
<%----%> called JSP annotations
Problems with the generation of spring and JSP expressions