Samuel Lugo

Greenhorn
+ Follow
since Feb 28, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Samuel Lugo

Hello,

I'm fairly new to Struts and I'm trying to use the html : options tag for the first time. The following worked when the collections attribute was assigned a List that I had set in the request scope: <html : options collection="listName" property="value" labelProperty="label" />. However, when I tried to use a List from my ActionForm, the following did not work: <html : options collection="myActionForm.listName" property="value" labelProperty="label" />. It gave me the following error message: Cannot find bean under name myActionForm.listName. Is what I am attempting even possible? Is there something else that I need to do?

Any help would be greatly appreciated.

Thanks in advance,
lugos
[ October 13, 2006: Message edited by: Samuel Lugo ]
18 years ago
I learned something new!

Thanks.
18 years ago
JSP
Hello,

What do your 'hidden' and 'visible' CSS classes look like?
Hello,

If I'm not mistaken, I believe you need to get the session first:

HttpSession session = request.getSession();
String st = (String) session.getAttribute("Table");

Hope that helps.
18 years ago
JSP
Hello,

Can a button be mapped to a member variable in the ActionForm? If it's clicked, true; if not, false?

Thanks,
lugos
18 years ago
OK, I got it to work. Thank you for your assistance and your patience Merrill.
18 years ago
Do you mean using the reset function from the ActionForm class? Because if so, I have that function commented out. The reason I do is because when it is not commented out, the data is not being passed from the intial JSP to the next JSP when I click submit. In between those two JSPs, I have another Action class that is used to do some error checking. If no errors are encountered, then they Action class forwards to the next JSP where the data is then displayed.
18 years ago
Merrill,

Thank you for your response. I tried the solution that you suggested, but it still does not clear the information. Could it be that the ActionForm is retaining the data? Could it be because the scope is set to session?
18 years ago
Hello,

I am writing my first Struts application. I have a form that has a drop-down box, two text fields, a 'Continue' button, and a 'Clear' button. The user makes a selection from the drop-down, and then enters information in the two text fields. When they click the 'Continue' button, they are taken to an intermediate page where their selection and information is presented for confirmation. On that page their is a 'Submit' button and a 'Cancel' button. The 'Cancel' button is an <html:button> tag with an onclick attribute that is assigned 'window.location.href='firstPage'. If the user clicks on the 'Cancel' button, they are taken to the initial page where they made the selection and entered their information. The problem that I am encountering is that once they are on that page, if they decide to reset the field values and they click on the 'Clear' button, the fields do not clear. The 'Clear' button is an <html:reset> button. I have tried using the regual html <input type="reset" value="Clear" /> button, but I get the same results.

As long as the user does not click 'Continue' on the intial page, the 'Clear' button ( <html:reset> ) works; the problem comes if they go to the next page, realize they made a mistake and go back using the 'Cancel' <html:button value="Cancel" onklick="window.location.href='firstPage'"> (not using the back button).

As I was writing this post I remembered that I commented out the reset(ActionMapping mapping, HttpServletRequest request) function in the Action Form. The reason I did so was because the values were not being held from one page to the next, even though I specified a session scope in the struts-config.xml. So that may be why the 'Clear' button wouldn't work if I use the <html:reset> button, but I still don't understand why the 'Clear' button doesn't work if I use the regular html <input type="reset" value="Clear" />.

I hope this wasn't confusing. Any help would be greatly appreciated.

lugos

[ July 31, 2006: Message edited by: Samuel Lugo ]
[ July 31, 2006: Message edited by: Samuel Lugo ]
18 years ago
Alright,

So you have a form, you enter the first and last name, you submit the data to the servlet, and you want the servlet to pick it up from the session...is that correct? I don't know if that's possible. The servlet has to pick up the names as parameters, set them in the bean, and then in the servlet you can put the bean in the session and then pick it up in the JSP that follows from the session, using JSTL if possible.
18 years ago
After a little more research, I think I found my answer...unfortunately it happens to be no. Thanks.

Here's my source:
http://forum.java.sun.com/thread.jspa?threadID=709681&messageID=4108562

lugos
18 years ago
JSF
Hello,

I'm very new to JSF. I've read through the tutorial on this site and others, and I've done two sample applications. My question is this, is it possible to invoke the managed-bean via or through the GET method. Is it even possible to invoke the manage-bean outside of a form? The two sample applications both used forms to invoke the managed-bean, which I assume is using the POST method. Any help would be greatly appreciated.

Thanks,
lugos
18 years ago
JSF
Makes sense. Thank you very much.

lugos
18 years ago
JSP
It did work, but I wanted to make sure it was legal. I'm fairly new to JSTL and I don't want any suprises down the road.

Thanks,
lugos
18 years ago
JSP
Hello,

Is it legal to put a conditional JSTL tag inside an opening option tag? For instance:

<option <c:if test="${userProfile.state == 'AK'}">selected="selected"</c:if>>AK</option>

Thanks for the help.

lugos
18 years ago
JSP