File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 1.2 Equal Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

Struts 1.2 Equal Tag

S Subbu
Ranch Hand

Joined: Mar 20, 2012
Posts: 87

Is there a way of comparing two session variables using struts logic tag.
Or
we can only compare variables with constants ?
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi Subbu,
Did you try bean:defining the session variable and used it as value in logic:equal's value attribute? I never tried but if doesnt work, there should be no other way i guess

I just looked into the struts source code for the implementation (EqualTag.java, CompareTagBase.java and TagUtils) and found that the value of 'value' is just taken directly and just being converted based on the object.

However, it makes sense, since these are session attributes, why dont we do the same comparison at action level and set it in the form to use it in the JSP - this should be the best way - any comments?



Have Fun with Java
little,little.. little by little makes a lot..
S Subbu
Ranch Hand

Joined: Mar 20, 2012
Posts: 87

Hi Shankar,

My Problem is Something Worst Coding. Try To Understand My Problem

I will Show Shift Details Of the employee in a select Box.

I am Getting ShiftMap and EmployeeMap(this contains shifts of employee on particular day)

I generate Select Box By Iteration ShiftMap and select the option which the employee has shift on particular day like

Iterating dates of employee
getting shift on particular day
Iteration Shift Map and generates select box
select above shift like <option value='1' selected>Gen</option>


i am using equals tag but it was not supported. Thats My Problem.Is any way to do this by using JSTL
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Struts 1.2 Equal Tag
 
Similar Threads
<bean:write> what is it please?
unable to update Div tag.
how to use struts-menu tag?
struts-html:base tag equivalent for Struts2?
how to compare two variables in struts logic:equal