简体   繁体   中英

Struts2 Form Tag

I am currently creating a web-application that is using Struts2 tags for form submission. One of the problem I see is that when I view page source it clearly shows my code, specifically how struts2 created the form. Something like this.

<tr>
    <td class="tdLabel"><label for="register_userBean_username" class="label">User Name:</label></td>
    <td
><input type="text" name="userBean.username" value="" id="register_userBean_username" class="class java.util.HashMap"/></td>
</tr>

      <tr>
    <td class="tdLabel"><label for="register_userBean_password" class="label">Password:</label></td>
    <td
><input type="text" name="userBean.password" value="" id="register_userBean_password" class="class java.util.HashMap"/></td>
</tr>

Is there anyway to prevent the users to see the underlying code that struts2 created for my form?

I don't think that there's a way to hide that without breaking the site. These informations seem to be vital to make the site work properly.

I agree with @Theolodis. There is no way you can hide the html-code that struts tag created for you. The objective of struts tag is to minimize your view page coding by providing tags that expand to required html code. And how in the world would you prevent the user to view code which is on his browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM