albert kao

Ranch Hand
+ Follow
since Feb 04, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
53
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by albert kao

The code has been changed to the following.
Can it be simplified anymore?
.java file


.jsp file
3 years ago

Jeanne Boyarsky wrote:Supposing your bean instance is called owner, this is how to use EL in a JSP to call it:



getNumber has two parameters : Integer index and String ownershipCode.
How to pass values to these two parameters in jsp using Struts 1.x library?
Thanks.
3 years ago
What is the syntax to call getNumber in a jsp?
3 years ago
Solution is:

3 years ago
How to do variable substitution in html:textarea?
e.g.
Java code


my.jsp


I try to make "lastName" to appear at my.jsp but get the following instead:
3 years ago

Jeanne Boyarsky wrote:Yes. What type of object are you iterating through on the form? As a first step, add helper methods to it such as getNumber() and getRequiredIndex(). This will get you move that java code into a Java object and out of the JSP.



The type of object iterating through on the form is:



Do I do something like this?
Please help.
Thanks.

3 years ago
The following Struts 1 jsp code is working fine.
However, is it possible to change the jsp code so as to remove all the Java codes?
If it is possible, please show the new jsp code as much as possible.
Thanks!
Existing code:


i.e.
New code will be similar to this:


3 years ago
If my jsp has several input elements, and I prefer the error message as close to the input elements as possible, how to code?
Do I have to put "inputErrorMsg1" and ""inputErrorMsg2" outside the loop or not?
e.g.
3 years ago

Jeanne Boyarsky wrote:Can you show the logic:notEmpty() code?


3 years ago

Jeanne Boyarsky wrote:Albert,
Why do you need the loop? Why not do logic:notEmpty? Or look at the list size?


There are more source codes. I omit them for clarity.
<logic:notEmpty> did not work - just like <logic:lessThan>
3 years ago
How to display error message only once inside a <logic:iterate> loop?
The following code does not work : the error message is displayed 4 times (the total number of the loop).
3 years ago
How to pass a parameter to value in logic:lessThan?
i.e. logic:lessThan will use a variable (not a constant) in value.
I tried the following code but it does not work at run time : the logic:lessThan test always fail.
jsp:
3 years ago
I am writing jsp page with Struts 1 which has the following requirements.
Option 1
Display "Owner" only once.
Display "X.jsp" after "Owner".

Option 2
Display "Owner1", "Owner2", to "Owner5"
Display "X.jsp" after "Owner1" and "Owner2"

Option 3
Display "Owner1", "Owner2", to "Owner5"
Display "X.jsp" after "Owner1" only

Option 4
Display "Owner1", "Owner2", to "Owner5"
Display "X.jsp" after "Owner1" only

The following code works for "Option" equal to 3 and 4.
How to modify it to work for all options (from 1 to 4)?
3 years ago
I try to pass data from Action.java to jsp page by httpSession.setAttribute and httpSession.getAttribute.
I do not get the same value when casting MyObj.
Please help.



MyAction.java



Log file:
2014-04-14 13:24:36,420 [ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' DEBUG xxxx.web.test.actions.MyAction - owner false activity true
2014-04-14 13:24:36,420 [ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' DEBUG xxxx.web.test.actions.MyAction - myObj2 Owner false Activity false
2
3 years ago
How to get the first element of a ArrayList at a jsp page with Struts 1?

e.g.






my.jsp


The given source code does not work:
'weblogic.kernel.Default (self-tuning)' ERROR org.apache.struts.tiles.taglib.InsertTag - ServletException in '/prot/pages/my.jsp': Cannot find bean: "accountList" in any scope
3 years ago