Ailsa Cape

Ranch Hand
+ Follow
since Aug 10, 2005
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 Ailsa Cape

Hi all,

I am designing a web page which is a test paper including 100 multiple-choice questions. It must meet two requirements:
A. 10,000 students using this page can take the exam simultaneously.
B. All the questions in this paper should be displayed at once when students log on. In another words, all students should use scroll bar to browse all the questions.
I want to know which one I should use, plain JSP or JSF?

If using JSF, every question will represent a UISelectMany component. So when the exam begins, each student will cause the server to create 100 this kind of component in the memory of the server during his/her own session. The total number of UISelectMany objects will rise to 1,000,000 after the exam starts. Based on this number, the server should have at least 20G RAM, is it right?

If I use plain JSP, then the memory occupied by JSF components will be free. So the size of server´┐Żs RAM can be reduced significantly. Could 2GB do the work? If it could, how about WebWork or Struts framework? Which one is better than plain JSP to fit for the job since I know little about them.

Thanks
Ailsa Cape
[ May 05, 2007: Message edited by: Ailsa Cape ]
14 years ago
JSF
Hi Richard,

I am sorry for missing that. But you can download the free chapter of this book in this site. The six needed jar files are jsf/lib/jsf-api.jar, jsf/lib/jsf-impl.jar, tomcat/server/lib/commons-digester.jar,
tomcat/server/lib/commons-beanutils.jar, tomcat/webapps/jsp-examples/WEB-INF/lib/jstl.jar, tomcat/webapps/jsp-examples/WEB-INF/lib/standard.jar.

Here the version of Tomcat must be 5.0.X, NOT 5.5.X and the JSF implementation version is 1.0 or 1.1.
Someone said when we use Myfaces package for MyEclipse to create a JSF project, there will be no error because this utility had added the listener tag in the web.xml.

Regards,
Ailsa
14 years ago
JSF
Hello everyone,

I have been studying core JavaServer Faces recently. After I test the sample application of number quiz in chapter 2, I always get the HTTP Status 500 error. Its description is:The server encountered an internal error () that prevented it from fulfilling this request.

The directory structure I use is the same as Figure 2-5 in page 47. After that, I compile the two .java files(ProblemBean.java & QuizBean.java) and place the generated .class files into the WEB-INF/classes/com/corejsf directory. I also add a directory named lib, which parent is WEB-INF. In the lib directory, six needed jar files are included(referenced in page 11).

After I put the whole application in the Tomcat's webapps directory and start it, I input "http://localhost:8080/numberquiz"in the browser and get the above error. I am eager to know the reason because I think I have done exactly accorging to what the book had instructed and correct two errors in the faces-config.xml(change index.faces to index.jsp). By the way, Tomcat version I use is 5.0.28, JSF is 1.0 and browser is IE6.0. After I had been looking the Internet all the afternoon, I finally find the solution to it. In the web.xml, I should add the following tags:

But I still don't know why I must do this. Please give me some advice!

Thanks in advance!
Ailsa Cape
[ February 07, 2007: Message edited by: Ailsa Cape ]
14 years ago
JSF
Hi Eric,

Thank you for your quick response! Can you introduce some material or web links which thoroughly discuss the subject to me?

Best Regars, Ailsa Cape
Hello Eric,

After I test the "document.execCommand('undo', false, null)" method, I find it works well in text-oriented HTML elements when you want to roll back what a user has done. Now I am eager to know how to undo the user's operation using Javascript. For example, in a web page which is used for writing questions for a quiz, a user will do from scratch when he logged on and he might take the following steps:

1) Press a select element to choose the nubmer of answers for the first question.
2) Create a table on the fly whose rows are equal to the previous selected number plus 1.
3)Fill in the question and its answers.
4)Generate a "Next" button on the fly automatically when he is about to input the last answer.
5)Press the "Next" button to write the second question.

How can I afford a list A to let the user undo the above operation and a list B redo these operation step by step? In other words, how can I implement this functionality using Javascript just like what we do in Microsoft's Excel?

Thanks in advance!
Regards, Ailsa Cape
Hi Bear,

Thank you for your reply. Yes, you are right. It is unnecessary one form per question, If so, when submitting the quiz,a lot of trouble can occur.
It should be one table per quesiton in a form.

Thank you again.
Regards, Ailsa Cape
Hello everyone,

Consider this situation, many teachers use a single web page to edit their quizzes at the same time. The number of questions in each quiz could be different. If I use one form to contain one question, which technology should I use in the web page to implement adding forms dynamically if necessary when a teacher uses it? Ajax or something else?

Thank you in advance!
Regards, Ailsa Cape
[ September 25, 2006: Message edited by: Ailsa Cape ]
Hi Ben and William,

I really appreciate your advice. According your instruction, now I come up with a new idea. In my webapp, I decide to create one instructor.jsp file for the lecturer. Every time when he/she presses the submit button to upload the quiz, its content, including the system time and the later generating quiz file name, will be stored as a record in a database's table. At the time the students need to do this quiz, they will first read from the table to create the quiz JSP file, like quiz09232006.jsp, and forward to it, then test it.

William, in your reply

Much better to come up with a more general solution that does not need to recompile a JSP for each quiz. How about a custom tag or JavaBean that reads a simple script that defines the quiz?


Do you mean the reading table section in the quiz09232006.jsp file should use custom tag or JavaBean?
The quiz results should be graded usually. Now I plan to use two steps to implement it. First, using application attribute to store the correct answer in the instructor.jsp file. Second, comparing each student's answer with the attribute's value and store the result in an other database table. Is it right?
Because the number of questions in each quiz are not equal, the instructor.jsp could not be instructor.html. Right?
Correct me, if I am wrong.

Best Regards,
Ailsa Cape
15 years ago
JSP
Hi Ulf,

Thank you a lot! Your answer is really helpful. I should first learn the instrucation to drag&drop carefully and try to apply it in my application.

Best Regards,
Ailsa Cape
Hello everyone,

I'd like to know whether the editing buttons in the Add New Topic page of this forume, such as , and BOLD etc, are made through HTML language or JavaScript and how to do so. I found in some web pages there are also several icon or buttons which can be dragged to the editing area. How can I do this?

Thanks in advance!
Regards, Ailsa Cape
Hello everyone,

Suppose this scenario. A lecturer dedices to provide several quizzes periodically for students. Because each quiz may not have the same number of questions, the lecturer have to use the instructor.jsp web page to edit a specific quiz every time, which can include a lot of single and multiple choice questions. Once the lecturer had done, the content of this quiz must form another JSP file automatically, which name should be like "quiz+system time.jsp" so as to distinguish from each other.

My question is whether I can only use JSP technology to accomplish the whole thing above and how I can do it. Please give me some advice about the general steps to do so.

Thanks in advance!
Regards, Ailsa Cape
15 years ago
JSP
Hello p,

Thank you for your reply. I think what we specified in the Deployment Descriptor's section, <method-permission>, is all the methods from client view, including the ones coming from a session or entity bean's home and component interfaces since there is a <method-intf> sub-element in this section which value can be assigned to Remote,Home etc. So I believe that a client must have the security identity to access the business methods defined in the component interface which should have been granted method permission in DD. Is that right?

Thanks in advance!
Regards,
Ailsa Cape
Hello everyone,

After I have read chapter 11 of the book HFEJB, I think the ejb-jar.xml file in AdviceBean which we had established in chapter1 should have declared the <method-permission> tab with a subtab <unchecked/> in it at least. For example,it should have the content like,

After I read the file, I find there is only one section defined by <enterprise-beans> tab. I know after deployed properly, the client does access the AdviceBean's business method(getAdvice()) without problem, why can a client call the bean's business method freely when it has not declared method access permission?

Thanks in advance!
Regards,
Ailsa Cape
[ June 03, 2006: Message edited by: Ailsa Cape ]
Hello everyone,

When I test my first EJB application using a remote client, a runtime exception occurs,

After I read some posts here which are relative to this subject, I add three new lines in my client code:

I don't quite catch these code and I still got another runtime exception after doing so,

I want to know what is the correct environment for a client accessing an Enterprise bean on a remote server running Sun's Reference Implementation? I use J2SE 1.3.1 &J2EE 1.3.1

Thanks in advance!
Regards,Ailsa Cape
[ April 02, 2006: Message edited by: Ailsa Cape ]
Hello everyone,

I want to know whether the Manning's book SCBCD EXAM STUDY KIT written by Paul Sanghera is appropriate for my goal. My aim is to pass the SCBCD exam successfully and to master the EJB technology in real work after the exam. So, what do you think which book is the best, this book or Head First EJB? If a person like me, who has little knowledge of EJB, what's the average time to prepare for this exam?

I have just took the SCWCD exam and got a shame score, although I passed. Perhaps I made light of it. I thought it was easy, but it really strikes my confidence. I have to admit that I have little experience in the JSP and Servlet technology but I did read up the Manning's book SCWCD EXAM STUDY KIT(Second edition)before the test. When I did the real exam, I found that some subjects are fresh to me. For example, the tag body content consisting of useBean action, MIME type mapping in web.xml, JavaBeans' constructors with parameters etc. So I think what Satou had said makes sense. Another key reason for my poor score is that I seldom visit this site.

My experience of preparing SCJD exam is pleasure, because I think much of this exam and discuss many problems with friends here. A lot of people, especially Andrew, gave me more helpful thoughts which are still useful in my real work today.

Thanks in advance!
Regards, Ailsa Cape
[ February 24, 2006: Message edited by: Ailsa Cape ]