michelle Wang

Ranch Hand
+ Follow
since Jan 12, 2004
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by michelle Wang

Hi, I find some of my buttons cannot work properly by using Firefox 1.5 which I just upgraded to. Sometimes need to click many times then it works, else if click only once nothing happens.Last time in Firfox 1.0.7 can work without any problem.
The buttons is outside the ActionForm in JSP.

the code for the pbm button is like this :
<input name="back" type="submit" class="buttons" value="Back" on Click="window.location='../action/ClientProfileEntryAction.do'">

Any one have same pbm as me?
[ February 06, 2006: Message edited by: michelle Wang ]
19 years ago
I use this tag lib, quite easy to implement:

http://jsptags.com/tags/navigation/pager/index.jsp
19 years ago
Hi, for your pbm, I have done a similer one and it works.

U said Once the submission is completed, it will redirect back to the first page, but it is a hyperlink redirect. I use meta to redirect the page to an action but not a static page, like this:

<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://localhost:8080/myApp/action/ShowEntryFormAction.do">

So I guess you can do this:
I believe to display the first page (which is that form), you should have an action class right? So just in the create email page (second page), you redirect it to call your first page's action class again, so all the form Bean's info will be displayed again.

Hope this helps.
19 years ago
I only make use of the action Form that when the first page is really a "Form", which means the page has text fields, check box, dropdown menu these user input elements and you need to validate them. Nobody say when using struts must follow every thing inside right? I just combining all the knowledge i know and choose the most suitable one to make it works, that's all.
19 years ago
Hi, do you know what is MVC structure? Struts is based on it and developed. Your JSP cannot directly call DB to do the search function right? So you will need a "action" class to handle the user request on the server side. So you can put the value u want pass to DB into a attribute with a request in JSP, like this:

<a href="../action/ShowClientProfileAction.do?clientID=<%=clientID%>">

Then in your action class, you may need to get the attribute first, like this:

int clientID = Integer.parseInt((String) request.getParameter("clientID"));

from here, your action class can use the clientID and call DB class to do the search function already.

Hope this helps.
19 years ago
Hi, thanks ! I change the validation from display error msg to display a error pop-up page, it works.
[ December 07, 2005: Message edited by: michelle Wang ]
19 years ago
I have a form with 1 textfield and a button. When I click on the button, the system will base on the input of the textfield to search for result. The search result will be displayed in a pop-up window and the parent window does not change.
I need to do nullable validation for the textfield.
Now my code the function can work, but the search result display in the same parent window.How to make it to be a pop-up window?

<html:form action="/action/CreateInvoiceRefQuotationAction" method="POST">
<logic:messagesPresent message="true">
<ul>
<html:messages message="true" id="msg">
<li><bean:write name="msg"/></li>
</html:messages>
</ul>
</logic:messagesPresent>

<table>
<tr>
<td>Quotation Reference No.</td>
<td><html:text property="ufQuotationID" size="25" maxlength="20" styleClass="normal"/></td>
<td><html:submit styleClass="buttons">View Quotation</html:submit></td>
</tr>
</table>
</html:form>
19 years ago
I using action message instead of action error. bcs in struts 1.2.x, a lot methods under action error have been deprecated already.

in my struts-config.xml i write this:
<message-resources parameter="properties.error_messages" null="false"/>

I using tomcat as my app server, so my error_messages.properties is in folder:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\UFIBM\WEB-INF\classes\properties\
19 years ago
Hi, I have already created a pager display a data list in my JSP, by using pg ager ,logic:iterate, pg:item these tags. And I use
<bean:write name="itemSupplier" property="supplierName"/> to display the data like a lable in the pager list, which is read only.

Now i need to disply the data in a text field and allow user to update them. I also need to submit each individual page to save the updated data in the text field.

Any one know how to using pager with input fields? Thanks
19 years ago
For me, I use String to display Date on JSP, bcs String is more easy for you to set the display format.
19 years ago
Hi,bcs you use this:
request.setAttribute("dao",myDAO);

So you passing the list to JSP using request, maybe you can try this:
addin scope="request" to your logic:iterate tag, and change property to type, like this:

<logic:iterate id="mydao" name="dao" scope="request" type="data"/>

same if your use session to pass the list, then set scope="session"

Hope this helps.
19 years ago
For the format of Date, I have same pbm as you, I can't find any way to solve it using struts's function. So I write my own DateUtil class to convert string to date, date to String these functions, so can used by the whole project.

And for the currency format, you can check with java API, I use this in JSP, note that the currency will change with your computer currency setting:

<%
NumberFormat currency = NumberFormat.getCurrencyInstance();
double totalAmount= invoiceObj.getTotalAmount();
%>
....
..
<td>Total:</td>
<td>USD</td>
<td><%=currency.format(totalAmount)%>
</td>
[ November 21, 2005: Message edited by: michelle Wang ]
19 years ago
That disabled field is in a ActionForm right? If all your fields in an ActionForm, no matter it is enabled or disabled, you still can do validation in your Action, which is the server side. The disabled function only cared in JSP level,so should have no pbm.
19 years ago
Hi Sudhakar, do you set the value of the hidden field using javascript? I had been having problem with using javascript with struts...Could you please provide sample code?
[ August 12, 2005: Message edited by: michelle Wang ]
19 years ago