Win a copy of Spring Boot in Practice this week in the Spring forum!

Mel Cen

Greenhorn
+ Follow
since Apr 23, 2011
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 Mel Cen

hi guys,

based on this code given by google search,


and my own codes:
combobox1



combobox2



my action class


i found out that the onchange works by making an ajax request but i have no idea how to control the processStateChange function.


this is what i get when i did the onchange.



Uploaded with ImageShack.us

can anyone guide me on how does document.getElementById("componentCombo").innerHTML = req.responseText; works ?

or how can i populate combox2 collection based on selection from combox1 the right way using ajax and sturts.

Thanks in advance.
11 years ago
Hi,

i'm getting this error : no natural-id property defined; need to specify [key] in generator parameters

this is my mapping file.

<hibernate-mapping>
<class name="Login.LoginBean" table=" User " >
<id column="userID" name="userId" type="int">
<generator class="identity"/>
</id>
<property column="userName" name="userName" type="string"/>
<property column="userPassword" name="userPassword" type="string"/>
</class>
</hibernate-mapping>

i have no idea why it does not work ! anyone can give me a clue ?

how do i map to a view without a primary key ?
Thanks.
Hi regarding this ,

how to i do pass parameter(s) to action form using html:link ?


this is my existing code.

<Start:link action="MenuSelectAction" paramId="selType" paramName="Menu.Menu" property="strLoginGo" paramProperty="master">Master Setup</Start:link>

im not sure how to use paramId, paramName,property and paramProperty tags as i encouter errors.


this is my action forward code.



thanks in advance.
11 years ago
regarding the problem ,

i cant get this piece of code to work.



<logic:present name="error" property="ErrorMessage">
Error: <bean:write name="error" property="ErrorMessage"/>
</logic:present>


If i am not mistaken, during the first time this page(Login.jsp) was load, this part of code will not be evaulated becoz error bean object is not present.

However, during submit, and i have debugged,

request.getSession().setAttribute("error", error);

gets executed and with mapping, the control was forwarded back to Login.jsp.

however, the code above was skipped again..

during object lookup, the object error is present but i am clueless on why it will not show the error?
==============================================================================

this are my tag lib(s)

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="Login" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

this is my ErrorClass class :



and this is my code



Update : got it working with a little google seach..
11 years ago
What's the recommended way to build system menu using struts?

how do i include parameters from the parent page to the next child page using this
for example this
<td> <Start:link forward="schedule">Master Setup</Start:link></td>
<td> <Start:link forward="schedule">Home</Start:link></td>
<td> <Start:link forward="test1">1</Start:link></td>
<td> <Start:link forward="test"2>2</Start:link></td>


the forward only forwards to a diff page,
but how do i include parameters from parent jsp to diff jsp ?

using beans ?
11 years ago
hi,

i am very new to JSP.

just want to ask, if there's multiple users login into a JSP websites, what's the best way to manage their variables, sessions via browser or classes via server side ?

.

I am new to struts.

What's the recommended way to build system menu using struts?

how do i include parameters from the parent page to the next child page using this
for example this
<Start:link forward="schedule">Master Setup</Start:link>



11 years ago