Solved

Velocity with checkbox

Posted on 2009-04-03
1
1,486 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 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now