Solved

Velocity with checkbox

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
network + 7 80
How can I do a Massively massive community reviewing-and-grading site? 7 70
recursion example 16 112
fibonacci ten numbers 4 30
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 …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

867 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

24 Experts available now in Live!

Get 1:1 Help Now