Kan Qiu

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

Recent posts by Kan Qiu

Is there a way to find user email account's quota, so when my applciation send email to the email account, I can check the default quota and how many size are available.
Thanks.
20 years ago
I have a web application, it ask user to login with password, after login, it will check user's email address, if user does not have email address or email address is invalid, it will disable all the menu in the page and ask user to input a valid an email address, after that, the web application will send an email to this email account, user have to enable the web site from the url link in the email. now, I get problem when I click the link, it would not remember the user and the user need to login again.(I ask user to not logout and leave the browser to open). I can copy the url and put the url in the open broswer, this will work. Is there a way user just click the link and enable the site without login again?
any help is welcome.
20 years ago
Anyone have met this error before in your JSP action? This is using JRun as Container.
java.lang.IllegalStateException
at
allaire.jrun.servlet.JRunResponse.getWriter(JRunResponse.java:307)
at
allaire.jrun.jsp.JRunJspWriter.initWriter(JRunJspWriter.java:62)
at
allaire.jrun.jsp.JRunJspWriter.print(JRunJspWriter.java:124)
at
jrun__error2ejspa._jspService(jrun__error2ejspa.java:42)
at
allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:39)
at
allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:228)
at
allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:196)
at
allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
at
allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088)
at
allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:89)
at
allaire.jrun.jsp.JRunPageContext.forward(JRunPageContext.java:298)
at
allaire.jrun.jsp.JRunPageContext.handlePageException(JRunPageContext.java:320)
at
jrun__WEB2dINF__pages__records__verifications2ejsp28._jspService(jrun__WEB2dINF__pages__records__verifications2ejsp28.java:299)
at
allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:39)
at
allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:228)
at
allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:196)
at
allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
at
allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088)
at
allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:89)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:972)
at
org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:408)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:269)
at
uiowa.isis.site.RequestProcessor.process(RequestProcessor.java:95)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
at
allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088)
at
allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:89)
at
allaire.jrun.servlet.JRunSE.service(JRunSE.java:1557)
at
allaire.jrun.servlet.JRunSE.service(JRunSE.java:1547)
at
allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:364)
at
allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:115)
at
allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at
allaire.jrun.WorkerThread.run(WorkerThread.java:75)
20 years ago
Thanks, Could you show me how to do it in the Javascript?
I my JSP, I have two drop down list, I want to enable or disable the second drop down list based on the selection from first drop down list, how I can implement this in JSP?
Here are the two drop down list.
<tr>
<td colspan="2" align="left">
<html:select property="selectedVerification">
<html ption value="">--please select a verification--</html ption>
<html ption value="0"> Scores Verification </html ption>
<html ption value="1"> Enrollment Verification </html ption>
<html ption value="2"> Semester GPA Verification</html ption>
<html ption value="3"> Degree Verification</html ption>
</html:select>
<div id="theSpot"/>
</td>
</tr>
<tr>
<td colspan="2" align="left">
<select name="selectedSession">
<option value="">----please select a session----</option>
...........
</td>
</tr>
I want to enable the second dropdown list only when user selected Semester GPA Verification.
Thanks for your help!
I have array dynamicly generated from JSP code,like this
<%
User user = (User)request.getSession().getAttribute("user");
String id = user.getSSN();
if (user.isDemoUser())
id = "483297701";
VerificationDAO verDAO = VerificationDAO.getInstance();
ArrayList list = verDAO.findAllSessions(id);
int size = (list==null?0:list.size());
String[] sessionValues = new String[size];
sessionValues = (String[])list.toArray(sessionValues);
String[] sessionLabels = verDAO.formatSession(sessionValues);
%>
I have two arrays. seesionValues and sessionLabels.
In my Javascript function InsertBox(). I don't know how to refer those two arrays. one question is, can I pass those two arrays as parameters? It seems I can not do that.
To make the question simple, How can I refer an array vaiable in my Javascript function ine the same JSP page. If you have an array String, How do I access the array from my Javascript function?
In my JSP page, I have following code to generate two arrays from database
<%
User user = (User)request.getSession().getAttribute("user");
String id = user.getSSN();
VerificationDAO verDAO = VerificationDAO.getInstance();
ArrayList list = verDAO.findAllSessions(id);
int size = list.size();
String[] sessionValues = new String[size];
sessionValues = (String[])list.toArray(sessionValues);
String[] sessionLabels = verDAO.formatSession(sessionValues);
%>
now I have a dropdown list, when user select one of the option, I want my javascript function to create another dropdown list by using those two arrays as values and lables. How can I pass those two arrays to the function.
Here is the code
<tr>
<td colspan="2" align="left">
<html:select property="selectedVerification" onchange="InsertBox(sessionValues,sessionLabels)">
<html ption value="">--Please select a verification--</html ption>
<html ption value="0"> Scores Verification </html ption>
<html ption value="1"> Enrollment Verification </html ption>
<html ption value="2"> Semester GPA Verification</html ption>
<html ption value="3"> Degree Verification</html ption>
</html:select>
<div id="theSpot"/>
</td>
</tr>
I got run time errors by doing this. please help!
[ December 12, 2003: Message edited by: Eric Pascarello ]
I need to get an id from jsp session Object, and pass this id to some other class and use it to get some data from database, and then display those data in an drop down list only if the user select an option from an existing dropdown list.
I used following code to get the id in the JSP.
<%
User user = (User)request.getSession().getAttribute("user");
String id = user.getID();
if (user.isDemoUser())
id = "483297701";
%>
I have a DAO class with method like
public Vector findAllData(String id)throws Exception{}
in my Form class, I did this
public class VerificationsForm {

private String selectedVerification;
private String selectedSession;

private String id;
private String[] sessionValues;
private String[] sessionLabels;
public void setSessionValues(){
VerificationDAO sgrDAO = VerificationDAO.getInstance();
Vector vec = null;
try{
vec =sgrDAO.findAllSessions(getId());
}
catch(Exception e){}
finally{
if (vec!=null && vec.size()>0) {
int s = vec.size();
sessionValues = new String[s];
vec.copyInto(sessionValues);
}
}
}
public String[] getSessionValues(){
if (sessionValues==null) setSessionValues();
return this.sessionValues;
}
public void setSessionLabels(){
String[] temp = getSessionValues();
int s = (temp==null?0:temp.length);
sessionLabels = new String[s];
for (int i=0; i<s;i++){
sessionLabels[i] = formatSession(temp[i]);
}
}
public String[] getSessionLabels(){
if (sessionLabels==null) setSessionLabels();
return this.sessionLabels;
}
public void setId(String value){ this.id=value; }
public String getId(){ return this.id; }
public void setSelectedVerification(String value){ this.selectedVerification=value; }
public String getSelectedVerification(){ return this.selectedVerification; }

public void setSelectedSession(String value){this.selectedSession=value;}
public String getSelectedSession(){return this.selectedSession;}
}
The problem is: It seems that the id that I need to ne used in the Form object can not be passed, it alsway get null value? so, this may not a good design to deal with the case. Any help is welcome.
20 years ago
How can I use Javascript to generate text input field base on user selection.
<select name="box">
<option value="1"> add 1 box </option>
<option value="2"> add 2 box </option>
</select>
if add 1 box is selected, I would like to have one more box generated after this dropdown list. if add 2 box is selected, I would have 2 box generated instead of just 1.
please help.
but I need implement this in JSP. and I am using struts_html tag library.
I have a dropdown list, user can make selection, and I need to add one or two more text input field depends on the selection. I guess I can use Javascript to handle the event, can some one tell me how to do that?
I have code like this, it used struts_html.tld
<html:select property="selectedVerification" >
<html ption value="">--Please select a verification--</html ption>
<html ption value="0"> Verification--Scores </html ption>
<html ption value="1"> Verification--Health Insurance </html ption>
<html ption value="2"> Verification--Good Studend Discount</html ption>
<html ption value="3"> Verification--Degree </html ption>
</html:select>
if user selected "Verification--Degree", I want add two more text input field, one for "startDate", one for "endDate".
if user selected "Verification--Good Studend Discount", I just need add one more text input for "semester".
please help.
If your company need java developer, let me know. I need a job.
Can some one help me to find a job. I have 3 yr industry working experience. CS degree and SCJP,SCWCD. My email is kanqiu@mchsi.com
Thanks.
21 years ago
The RexIP server just generate class file, not java file, so I can not see the code, but I think you are right. and I also tried this in Tomcat, then I got error. So in general, we should not call page.getServletInfo().
Thanks.