Michal Bienek

Greenhorn
+ Follow
since Jun 17, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michal Bienek

As far as I'm aware, there are no taglibs for mathematical operations in the Struts framework.
You'll have to perform the operation between scriptlet tags, or (the better solution) is perform anything you need within the action that's the predecessor for your jsp page. You jsp should, in theory, not need to perform such calculations, merely present the results.
18 years ago
It appears that you do not have the LookupForm populated in your request or session prior to your jsp being displayed and by specifying:

you are telling the jsp to populate itself based on a bean that's already expected to exist.
Check if removing the name/type from the html:form tag helps you.
18 years ago
This wouldn't necessarily be struts-specific, but all you need to do is identify the user in the action that is executed prior to your jsp display. In your jsp, you can use <logic:equal> and <logic:notEqual> tags to figure out what type your user is in order to display your form fields.
You can do this much cleaner with JSTL tags, but I don't know them well enough to provide a code sample. Here it is with struts tags:
19 years ago
There is no direct struts benefit to doing what you're trying to do. It may, however, be a little easier if you change your xml into an actual ActionForm class that could provide an easier interface into posting from your form and doing the processing of the XML in the background (before it ever reaches your eventual Action).
Do you have any error logs?
What do you mean by "not being able to do anything"? Is the jsp not loading properly after the initial hit?
One issue could be that you are clearing the array, as this is being passed by reference, are you sure you are not making modifications that you expect to remain the arraylist in between requests?
Perhaps including the code to both version of retArrayList(...) could be beneficial.
Michal
19 years ago
JSP
By having this code in b.jsp, you will never have a requestURI of a.jsp.
By doing a jsp:forward, you are internally changing the location, but the request URI will not change. The browser requested b.jsp and nothing else. Therefore, b.jsp will never be referenced by a requestURI of a.jsp.
I must be missing something in your problem statement.

here's the flow:
browser (request b.jsp) -> webserver -> b.jsp (forwards to) -> a.jsp

say b.jsp told the browser to redirect to a.jsp, then the flow would be:
browser (request b.jsp) -> webserver -> b.jsp (redirect to a.jsp) -> browser (now request a.jsp) -> webserver -> a.jsp

In no way can a webserver, when getting a request for a.jsp, would respond to the request with b.jsp (unless you are aliasing a.jsp to point to b.jsp, but based on your problem statement, that doesn't seem to be the case)
19 years ago
JSP
The format you are getting is unicode. I'm not sure of what your intension is with the display of the filename. Check on how your browser (which must have the display capabilities for Chinese unicode characters) displays the filename (say if your application displays it thereafter) to see if the unicode representation of the name matches the filename initially sent in.
Otherwise, here's a forum on converting unicode to big5.
Java Technology Forum - Convert unicode to hex(Big5 Hex)
Generally it can be assumed that they are started in order in which they appear since XML parsers must maintain the tag order from the config file.
I haven't seen ActionMessages used as part of an action form's validate method. As far as I know, unless you return a list of ActionErrors, nothing will be saved to the request for processing by the input page. In order to see the ActionMessages in action, I would suggest that you create a single action in which you do the following:


Make sure that your struts-config for the page you want to forward to has

redirect

set to false, and that the page itself has the tag.
You're on the right track. The breakpoints are the right things to use, and yes they will show the thread in the Debug perspective. However, you should also be able to see any variables set at the breakpoint in the Variables view, the breakpoints in the Breakpoint view, and the source code in the Source view. In case your settings got buggered up, go to Windows/Reset Perspective, and all the right views (including source) should show up as part of the Debug Perspective.
This is all assuming that when the breakpoint is traversed, your threads actually pause. If this is not happening, then the code path you have set your breakpoint on isn't being traversed.
You need to add an ItemListener, not an ActionListener to obtain combo box selection events. You'll need to implement an itemStateChanged(ItemEvent e) method in which you can retrieve the selected combo box value via e.getItem(), and then populate your text area with that.
19 years ago
If you are attempting to perform a util.getValue() to fetch the value after it is set, you will not get a value since you initialized the myVal String within your util.setValue(String str) method. In order to retrieve this value, you will have to create a class member that you would populate in the setValue(String str) method and retrieve via the getValue() method
19 years ago
You are not really integrating with JBOSS, you would be deploying your Struts web application on Jetty (which sits in JBOSS). So you would need to create a .war file containing all your JSPs, with a WEB-INF directory containing a lib directory, which must contain all your struts libraries. That's what seems to be missing from the error you are getting.
20 years ago
It seems like you guys are really complicating the initial question. It sounds to me like you have an action that currently forwards to a jsp page requiring cleanup or a data fetch. All you really need to go is make your action forward to another action (which will perform your preprocessing), and then that one can forward to your jsp page.
JSP -- submit ---> ACTION --- findForward("preprocess")----> PREPROCESS_ACTION ---- findForward("success")-----> JSP
20 years ago
I agree with the previous post. The object-oriented nature of the Struts framework significantly eases maintenance of web applications, and optimized reuse of its different components. Previous to Struts, we were using lone JSPs to do a lot of the processing that should not have been done by a JSP. Performance was lagging, reuse was non-existant (copy-paste previous solutions), and maintenance became a nightmare once more people were brought on a particular project. Struts has also helped in design estimates, as each set of components lends itself very well to formulas (with some form of qualifier for more complex Actions, for example). There are potentially many solutions out there, but none seemed to help us more than Struts.
20 years ago