?
Solved

Velocity with checkbox

Posted on 2009-04-03
1
Medium Priority
?
1,514 Views
Last Modified: 2013-11-23
Hi,

I am trying to use velocity and I cant really get things to work.
I want a checkbox. If it is checked it should send the value TRUE to a class in my java code

How should this be done?
my velocity code:
        <tr>
        <td class="header">Hibernate&nbsp;databas&nbspupdate</td>
        <td>
        <input type="checkbox"  value ="$Deployment.hibernate">true/>
        </td>
        </tr>
--------------------------
my class is named Deployment and i have a boolean in there called hibernate

Open in new window

0
Comment
Question by:Mickeys
1 Comment
 
LVL 8

Accepted Solution

by:
n_sachin1 earned 2000 total points
ID: 24060390
Velocity does not work the way you are trying to use it in the above case.

Velocity is a templating engine, that could generate pages for you. For eg:-
the below line
<input type="checkbox"  value ="$Deployment.hibernate">
would produce
<input type="checkbox"  value ="true"> or <input type="checkbox"  value ="false"> based on the value of $Deployment.hibernate.

To set values on a user action into a class, you will need to go through a servlet/jsp.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question