Results 1 to 2 of 2

Thread: Can Spring automate generate jsp with spring tags for domain object ?

  1. #1
    Join Date
    Aug 2009
    Posts
    167

    Default Can Spring automate generate jsp with spring tags for domain object ?

    suppose I have domain class:
    Code:
    public class Procedure {
    	private Integer id;
    	private String name;
    	private Date startDate;
    	private Date endDate;
    	private Date outReturnDate;
    	private String esg;
               private boolean gender;
    
    // getter and setter
    Controller
    Code:
    public class ProceduresController extends MultiActionController {
    ...
    	public ModelAndView create(HttpServletRequest request,
    			HttpServletResponse response) throws Exception {
    		removeAllDocumentsAndCharges();
    		ModelAndView mav = new ModelAndView("procedure", "commandName",
    				new Procedure());
                    return mav;
    }
    Then I by hand create jsp for this domain object.
    HTML Code:
    <form:form method="POST" name="mainForm" action="add.htm" commandName="commandName">
    
    ...
    		<tr>
    			<td><label><spring:message code="name" />*</label></td>
    			<td><form:input path="name" size="32" maxlength="255"
    				readonly="${isReadOnly}" /> <br>
    			<form:errors path="name" cssClass="styleErrorMessage" /></td>
    		</tr>
    		<tr>
    			<td><label><spring:message code="startDate" />*</label></td>
    			<td><form:input path="startDate" size="32" maxlength="10"
    				readonly="${isReadOnly}" /> <br>
    			<form:errors path="startDate" cssClass="styleErrorMessage" /></td>
    		</tr>
    Can Spring automate generate jsp for domain object? E.g. for property name generate <form:input path="name" , for property gender generate <form:radiobutton path="gender" and so on.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    No it cannot... Maybe if you use Spring ROO that can help but spring doesn't generate jsp files.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •