This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

howard franklin

+ Follow
since Sep 09, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by howard franklin

I am new to struts and I am trying to learn logic:interate.

I am trying make changes to the following code.

<logic:iterate name="testDateStrList" id="testDate">
List Messages <bean:write name="testDate"/>

I created this on my action

String myDate = "01/01/2013";

on my jsp I want to test the arraylist value with my object.
I know that the logic:iterate works with an arraylist. However can
it work with an object to perform a comparison?

<logic:iterate name="testDateStrList" id="testDate">
List Messages <bean:write name="testDate"/>

<C:if test="${testDate == myDate}">
<h2>hey the daate is <c:out value="${testDate}"/></h2>

In this example it passes the if statement no matter what.

My results.... Not sure what the if statement is comparing.
This (testDate == myDate) should be 2 string . I am not sure

List Messages 01/10/2013

hey the daate is 01/10/2013
List Messages 07/01/2013

hey the daate is 07/01/2013
List Messages 06/18/2013

hey the daate is 06/18/2013
List Messages 01/01/2013

hey the daate is 01/01/2013
List Messages 06/19/2013

hey the daate is 06/19/2013

8 years ago
I posted it to soon.. I added the following and it worked..

for (int i = 0; i < collection.size(); i++){

// Date test = collection.get(i);
System.out.println("Item " + i + " : " + collection.get(i) );
System.out.println("You were arrested on : " + collection.get(i).getArressDate());
System.out.println("Your offense was on : " + collection.get(i).getOffenseDate());


// for(String item: stringList){
// System.out.println("retrieved element: " + item);
8 years ago
I am trying to learn how to print out an array of objects;
I can print the collection such as the followign.


How do I print out the items in each.
arrestdate: Thu Jan 07 00:00:00 PST 1999
offensedate: Sun Feb 07 00:00:00 PST 1999
arrestdate: Sun Mar 07 00:00:00 PST 1999
offensedate: Wed Apr 07 00:00:00 PDT 1999

import java.util.Date;
public class arrestDateStrList2 {
private Date arrestDate;
private Date offenseDate;

public arrestDateStrList2(Date arrestDate, Date offenseDate) {
this.arrestDate = arrestDate;
this.offenseDate = offenseDate;

public Date getArressDate() { return arrestDate; }
public Date getOffenseDate() { return offenseDate; }

package MyTest;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;

public class myArrayLists {
public static void main(String [] args) {
Date newDate = new Date(99,0,7);
Date newDate2 = new Date(99,1,7);
Date newDate3 = new Date(99,2,7);
Date newDate4 = new Date(99,3,7);
Date newDate5 = new Date(99,2,7);
Date newDate6 = new Date(99,3,7);

System.out.println(" date: " + newDate);
System.out.println(" date2: " + newDate2);
System.out.println(" date3: " + newDate3);
System.out.println(" date4: " + newDate4);

ArrayList<arrestDateStrList2> collection = new ArrayList<arrestDateStrList2>();
arrestDateStrList2 yeah = new arrestDateStrList2(newDate,newDate2);

// size() tells me how many slots are in the list
System.out.println("number of slots: " + collection.size());

arrestDateStrList2 sesameSt = new arrestDateStrList2(newDate3,newDate4);
// size() tells me how many slots are in the list
System.out.println("number of slots: " + collection.size());

arrestDateStrList2 third = new arrestDateStrList2(newDate5,newDate6);
// size() tells me how many slots are in the list
System.out.println("number of slots: " + collection.size());

System.out.println("now using iterator");
Iterator itr = collection.iterator();

//use hasNext() and next() methods of Iterator to iterate through the elements
System.out.println("Iterating through ArrayList elements...");


8 years ago
I created a new base layout page called createdby_layoutIa.jsp

I created the definition to define it

<definition name="createdby.layoutIa" path="/createdby_layoutIa.jsp">
<put name="title" value=""/>
<put name="body" value=""/>

I create another definition that extends it.
<definition name="intake.assignment.summary" extends="createdby.layoutIa">
<put name="title" value="Intake Assignment Summary"/>
<put name="body" value="/WEB-INF/intake/intake_assignmentsummary.jsp"/>
<put name="displayheader" value="false"/>
It works but the page createdby_layoutIa.jsp has a small blue question mark by it in the project explorer.
Does anyone know what this question mark means?
8 years ago
I built a link using

<a href='int/<bean:write name="inta" property="id"/>'>

Once rendered it filled in the



I built another link where I passed in information to a function.

function used

html calling function

<a href="javascript:setSId('484919','N/A','int/')"/>P388</a>

However when it throughs this link using document.location.href the link is missing


I know this because I contactenated that part and it worked.

What do I need to do to use document.location.href in order for it prefix in the domain.

Or is there another way I can call a function and after the function has run fire off the link

I am looking at some code that I think is using a lov control. Can anyone point me to an lov control tutorial.

headers="TO Identifier,First Name, Last Name, Area Office"
<ms:lovFilter property="dId" value="0" operator="gt"/>
<ms:lovFilter property="subRoleCode" value="IpO,ISPO" operator="in"/>
9 years ago
This page is submitted using button that calls a function that submits the page using the dom.
After it sets a function/parameter

document.forms['I'].elements['function'].value = 'addOffice';

This sends it to the action addOffice.

My question is about the saveToken.

I understand that saveToken() - generate the token key and save to request/session attribute.

My problem is that I am debugging this and I see that it does not get pass the SaveToken(request) statement and then
my page refreshes. Is there something that I am missing here?

I appreciate any help

resetParentStatement(request, frm);
setRequestAttributes (request, frm, null, true);
saveToken (request);

//return mapping.getInputForward ();
ActionForward testActionForward = mapping.getInputForward();
StringBuffer path = new StringBuffer (testActionForward.getPath());
ActionForward myNewActionForward = new ActionForward(path.toString());
myNewActionForward.setRedirect (true);
return myNewActionForward;

9 years ago
I was able to figure it out

info from struts config

9 years ago
Can not figure this out.. I keep getting the following error.

[ServletException in:/SelectListTest.jsp] javax.servlet.jsp.JspException: Cannot find bean streetlist in any scope'

At the moment my action is called. ( I would think that this is populated.

Is there anything else that I should be looking at. Was able to make the example work. I am trying to incorporate what I did there
and I am not having any success.




9 years ago
Question about the Following code.

I understand that this is use to get the connection from Struts DataSource:

dataSource = getDataSource(request);
myConnection = dataSource.getConnection();

My confusion is what does request stand for.
9 years ago
Do you guys understand the parameter=”function”?

Is the function being being pass to IntakeClerkAction?
Or is it being passed to the forward action?

<action path="/intakeclerk"

<forward name="editTake" redirect="true" path="/"/>
<forward name="error" path="/"/>
<forward name="invalidaddress" path="/"/>

9 years ago
Thank you. That did it. I really appreciate your help

I thought my problem had to do with the current_session_context_class.

I change from
<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
<property name="current_session_context_class">thread</property>

but I am still having problems. Looking at the console looks like I got through everything
except for the current_session_context_class and the mapping.