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

David Donovan

Greenhorn
+ Follow
since Jul 27, 2001
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 David Donovan

Thanks guys ....

<%! private int userID; %> was the culprit at the top of my .jsp

It's so easy to overlook something so simple. Now I'm going to migrate to a servlet for obvious reasons.

Thanks again,
Kosaic
17 years ago
I have Tomcat 4.1.30 installed on Win2K Server with latest SP and running fine. The problem I'm having is this:

A user log's in , and they are authenticated against a SQL Server database. When a match is found, some information is saved in a session variable. Particularly a value called "userID", which is a 6 or 7 digit number.

The user then is forwarded to a page that does a Database retrieval of some statistics based on their unique "userID" , and all this information is displayed in a JSP. ( The JSP does all the work. Queries and all ) I have yet to make Servlets do this work and let the JSP handle displaying ...

Problem is this: After 2 different users log into the system , and see their initial statistics, if they were to both hit "refresh" ( F5 ) at the same time ( or very close proximity ) , they could very possibly see each others stats instead of thier own.

Upon refresh, the JSP is supposed to grab the unique "userID" from the session, and use this for all the queries for this particular page.

How is it possible that users at times ( say 5% of the time ) can get someone else's statistics and not their own ? I thought sessions were unique to each user ?

I've checked and double checked the page and cannot see anything obvious that is causing this problem.

ANY help or tips would be greatly appreciated.

Kosaic

java@nbnet.nb.ca
17 years ago
I have a Servlet that after a quick haul through my database, set's up a Vector of "Users". Each "User" had about 10 attributes that are set via a javabean.
One of these Attributes is of type double, and I need to sort the entire list of "Users" based on this double variable in each, from highest to lowest.
So right now to get that value, I use "u1.getTbws()", which returns me a double value for 1 particular user.
How can I get this value for each user ( about 40 users on an average ), and sort them from Highest to lowest ? (sort the entire Vector for display purposes in my JSP)
Any help/suggestions/examples would be tremendously helpful.
Thanks,
java@nbnet.nb.ca
[ April 06, 2004: Message edited by: David Donovan ]
18 years ago
So , using jspSmartUpload ... What would be the exact code to get the filename from within a JSP page ?
I ultimitally want to use it in : <%= strFileName %> this way ....
What exactly i'm doing , now that your all curious is starting with a file_upload.jsp page , which calls the upload.jsp page to actually upload the file. From there, upload.jsp forwards (with a refresh meta-tag) to a file_details.jsp page. It's within that particular page I want to pre-fill a disabled form field with the actual file name. This info is written to a database for use elsewhere on the site ( support downloads pages )
This make since ?
Thanks,
David
18 years ago
Thanks ... works fine up until i get to my servlet ... It is seeing null when I try to access via request.getParameter("file_name"); (changed variable to file_name)
Does this have something to do with the ENCTYPE ??? Please read up for the exact ENCTYPE that I'm using.
The Javascript seems to write the hidden field perfectly , but I still cant get at it when I get to my servlet.
Thanks for all the help folks ! Greatly appreciated.
David
18 years ago
Thanks for your replies. I now see how to do it using JSPsmartupload , which I am using ....
BUT , isn't there a simple way to get a name from this textbox"
<INPUT TYPE=FILE NAME=FILE1>
??
Put all upload and download processing aside. There must be a way to simply capture that text value for FILE1 ?
Thanks agaain,
David
18 years ago
Thanks for the reply however I'm not sure my question was clear enough.
I dont want to do ANY processing ( uploading or deleting ) , I just want to get that text value from the <INPUT TYPE=FILE NAME="FILE1"> text box.
I have all the other processing in place , just want to capture the text value of what is in that box upon POSTing to the servlet.
It could be any old extension , doesnt matter. I just need to get the name of the file that is being uploaded , and place it in a String.
Thanks
[ September 14, 2003: Message edited by: David Donovan ]
18 years ago
I have a simple html page for uploading a file. The whole file uploading thing is working fine , but would you believe I cannot figure out how to get the actual text from the given code below , in my servlet.
<FORM METHOD="POST" ACTION="/servlets/upload" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50">
<INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
So lets say a user clicks the "Browse" button and locates the file for upload. It's: c:\files\somefile.txt
I want to , in my servlet (doPost) grab this information. I want to have c:\files\somefile.txt assigned to a String so I can use it from there.
I'm sure this is simple , just having a braincramp here.
Thanks for all you help in advance.
David
18 years ago
Thank you ..... Keep up all the great work at this site. I will contribute whatever I can along the way.
Cheers
Hi All,
Gonna attack the SCJD certification starting almost immediately. I have a few questions I'd love answered if possible first.
1 What version should I do ? Is there a different assignment for 1.4 or you just get to use all the new tools ? Would the test portion be any different ?
2 I'm able to dedicate myself to this cert. Full-Time so how long would it take ?
3 I've been teaching Java for 1+ years now so I would hope its not brain smashing tough. Is it ?
4 Books ? Whats the best thing to use here. I have a 1.2 study guide , but are there others which may be better ? ( or worse )
I look forward to all the replies and also hanging out here as I work away at this certification.
Cheers.......
SJCP , IBM Solution Developer ( OOAD w/UML , VisualAge , Websphere ) & MCP ...
Take a look at the following code ( incomplete ) I'm looking for someone to explain this to me so I can understand how this all ties together. I'm having a hard time making the connection between the offScreenImage and the offScreenGraphics ...
<BR>
Image offScreenImage;
Graphics offScreenGraphics;
public void init() {
offScreenImage = createImage(getSize().width,getSize().height);
offScreenGraphics = offScreenImage.getGraphics();
}
public void update(Graphics g) {
paint(g);
}
public void paint(Graphics g) {
offScreenGraphics.setColor(getBackground());
offScreenGraphics.fillRect(0,0,getSize().width,getSize().height);
offScreenGraphics.setColor(Color.black);
offScreenGraphics.drawString("Kangaroo:,20,50);
g.drawImage(offScreenImage,0,0,this);
}
I'm having a hard time understanding the drawing of the offScreenImage , when it appears that we are drawing to the offScreenGraphics instead.. ?!? Can someone explain this to me and hopefully clear this up ?
Thanks in Advance.
20 years ago
Sorry,
Yes the practice exam for 486 has changed. The Real exam however has NOT changed at all.
Cheers
Here are my opinions of most of your questions. I have written and passed the real test with an 83% ... Some of these practice questions are silly as far as I'm concerned. The real exam is much more straight forward. Harder to read between the lines !
Best of luck....
1. Refer to the exhibit to answer the question.What are the system's actors in the diagram?
* c) Clerk, Manager, Bank network
Exhibit
Single select answer
2. Which of the following are TRUE about software architectures?
* a) Two tier software architectures do not scale to as many clients as three (or more) tier architectures.
* d) Dividing the application architecture into Model, View and Controller layers leads to flexibility.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
3. Which of the following is TRUE about a deployment diagram?
b) Dependencies between deployment components tend to be the same as the package dependencies.
Single Select - Please select the best answer (one and only one choice must be selected).
4. A system undergoing performance testing is found to be "thrashing" (a condition that occurs when there is too much concurrency). Which of the following artifacts would be MOST helpful to uncover the problem?

b) A state diagram
d) An activity diagram
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
5. Refer to the exhibits to answer the question.
There are two new requirements for IBMStore.com: discounts for damaged goods, and searches by size and color. Using Figure Sample 2, which of the following is the BEST way to extend the class diagram to handle these requirements?
b) Create a new class "PhysicalProduct" that represents an actual product in the warehouse. Associate the PhysicalProduct with its related InventoryProduct.

Exhibit: https://certify.torolab.ibm.com/figures/486fig4203137.gif

Single Select - Please select the best answer (one and only one choice must be selected).
6. A resulting benefit of using polymorphism is reduction of:
c) case statements and conditionals.

Single Select - Please select the best answer (one and only one choice must be selected).
7. Refer to the designs below:
- In Design #1, the Catalog object has a getProducts() method, which returns a xx collection object, such as a Dictionary or array, containing all the Products the company sells.
- In Design #2, the Catalog object has a getProductNumbered(anIdentifier) method, which returns the Product with the specified unique identifier.
Considering a requirement to get a specific product, which of the following BEST characterizes the two designs?
c) Design #1 adds brittle coupling. Design #2 maintains the encapsulation of the Catalog, making future design changes easier.

Single Select - Please select the best answer (one and only one choice must be selected).
8. Refer to the exhibit to answer the question.
Which of the following correctly describes the relationship?
a) Access to SalesLineItems is by Product. A SalesTransaction can have multiple SalesLineItems for one Product.

Exhibit: https://certify.torolab.ibm.com/figures/486fig46037.gif

Single Select - Please select the best answer (one and only one choice must be selected).

9. Refer to the partial requirements below:
When the loan officer receives the completed application for a new mortgage, a folder will be created for the customer. The loan officer will then commission an appraisal of the collateral property and request financial information from the customer's financial institutions and workplace. Which of the following is TRUE?
b) Some of the verbs in the requirements become methods of the nouns they reference. E.g., a FinancialInstitution class would have a getFinancialInformationFor( aCustomer ) method.

Single Select - Please select the best answer (one and only one choice must be selected).
12. In an OO system, it is desirable to assign responsibilities:

a) according to interaction diagram messaging.
c) relatively evenly across the classes.

Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
13. Refer to the exhibit to answer the question.
What methods MUST be implemented by the Account class?

a) withdraw, checkBalance
Exhibit: https://certify.torolab.ibm.com/figures/486fig55057.gif

Single Select - Please select the best answer (one and only one choice must be selected).
14. What are good practices to follow during refactoring?

a) Renaming a method and moving a field from one class to another should be done in small steps, testing changes as required.
b) Break down classes that are heavily loaded with responsibilities into smaller classes and distribute the responsibilities among them effectively.
c) Consolidate similar methods from different classes in the same type hierarchy into a common super class wherever possible.

Multiple Select - Please select all of the correct answers (this question has 3 correct choices).

15. During implementation, the development team decides to use a third party utility to provide some of the required functionality. What OOAD artifact would MOST likely reflect this change?

d) Interaction diagram

Single Select - Please select the best answer (one and only one choice must be selected).
**********************************************
Hey All,
The practice exam has been updated. They must have done this just today, as yesterday it was the same old thing.
You now have to do 56 questions (passing score is 67% on the practice exam now ), some of which are NEW ones , and some have been reworked from the previous practice exam.
Everyone go check it out as there will be lots of new discussion on it I'm sure ....
Cheers
For all those patientally awaiting my completeion of the exam , I havent re-did it yet. Looking at mid next week to do so. I havent had much time to study but am shooting for next Wed. or abouts.
Any suggestion on what to study regarding "Static Modelling" ? That seems to be the toughest category on the exam , but I cant find anything that closely matches this skill. Is it something that comes with experience more so than Books ?
Thanks