Jason Kwok

Ranch Hand
+ Follow
since Mar 31, 2005
Merit badge: grant badges
For More
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 Jason Kwok

Hi Peter,

Thanks for the praise, I appreciate it! As for the equality, I wasn't too happy with it either, and wasn't at my desk to actually test how well it would actually work.

I think that's why I ended my post with: "I'm sure there's a much more elegant way of doing this, but obviously I'm not aware of it!"

Thanks again Peter!

Jason
16 years ago
Hi Melinda,

You have a couple options. You could add some javascript to your JSP page to check the form input value as soon as the focus leaves that input box and generate an alert if a decimal value has been entered. Or if your posting to a servlet, then you could do something simple like:



I'm sure there's a much more elegant way of doing this, but obviously I'm not aware of it!

Hope that helps.

[ July 17, 2007: Message edited by: Jason Kwok ]
[ July 17, 2007: Message edited by: Jason Kwok ]
16 years ago
I'm not a Tomcat expert by far, but I'll give my 2 cents worth below. On a related note, I'd recommend checking out the Tomcat forum provided here, you'd probably get better results than here in the JSP forum.

I want to install TOMCAT on my work PC, this will open a port (local). Correct?.



Yes, Tomcat will run by default on port 8080, and accessed through the localhost.


Is this going to create any problem?. Can any one from outside the network access my PC?.



This should be fine, and only accessible by computers within your local or private network UNLESS a web server connected to your network is currently listening to port 8080 and no other applications are currently using it. Again I'm no expert, so I'd recommend checking out http://tomcat.apache.org/ for more information.
16 years ago

Originally posted by Jason Kwok:
I did a quick google search for 'javascript dropdown population' and found this page, among many:

http://javascript.internet.com/forms/dropdown-box-population.html

You'll have to do some work there to make it work for your example, but I think this will show you how to get the job done.



Did you take a look at this javascript example yet?
Hi Mark,

Referring to what Bear had said, you would do something like this:

<a href="<%= request.getContextPath() %>/showUserData.do?employeeID=${personUserName.employeeID}" >

This will send a parameter called employeeID along with the request, which can then be retrieved by your Servlet to find your employee account information.
16 years ago
JSP
This is a HUGE stab in the dark because I haven't used Hibernate before and as such, I may be completely off base here, but this looks similar to using a PreparedStatement which I've used to work with MySQL. Try this:

... where ((id) Like ?)

query.setParameter(1, "123%");
[ July 06, 2007: Message edited by: Jason Kwok ]
I did a quick google search for 'javascript dropdown population' and found this page, among many:

http://javascript.internet.com/forms/dropdown-box-population.html

You'll have to do some work there to make it work for your example, but I think this will show you how to get the job done.
I would retrieve whatever attribute you need from the database using a servlet , attach that attribute to the request object and then redirect to the JSP page where this javascript exists.

In that JSP page (I'm assuming it's a JSP page otherwise it won't work), you could then retrieve the attribute from the request object, and use it in your javascript.
[ July 06, 2007: Message edited by: Jason Kwok ]
Well I can tell that that example is for books, and as such, if books are your chosen product than it should be sufficient for a good portion of the functionality.

However, make sure you get a clear picture of what you want out of this application. If you're not intending on allowing customers to log in or create accounts, place orders, or make a payment... then several of those tables are unneccesary.
16 years ago
JSP
Well if you want to start small, I would begin by picking a product and deciding on what information you will need to keep.

For instance you'll need a primary key (I'd recommend using a surrogate), a product id, title, price, weight, height, width, depth, quantity in stock, description, etc.

If I were you, I would begin with the product. Get a database started and think about just making a catalog of your items. After that, you can move to the next step regarding a shopping cart.
16 years ago
JSP
Making a simple shopping cart application, if that's truly what you need, isn't too difficult but takes quite some time to produce properly. Employing a design pattern, like MVC, for your application is essential in my opinion.

Before you do anything, I would spend a little time thinking about your scope and just how big this application needs to be. What I mean by that is... do you want a simple product catalog and be able to add items to a cart? Or do you also want users to register accounts, be able to log in, view past purchases, etc.? Will items ever go on sale? Is inventory going to be maintained?

Working out the logistics of your application is important before you get too deep. As well, it will help you figure out what you need to look for in terms of tutorials and other resources as you go along.
16 years ago
JSP
This is a little off topic, but just in response to your original scenario "suppose if i want to store Login detail that is USERID and PASSWORD"...

I just wanted to say that, at least in my opinion, saving passwords to a session isn't a good idea because having the password in the session would serve no purpose after the user has successfully logged in. Just something to consider, perhaps there are scenarios were storing passwords might be useful?
16 years ago
Ulf is right, it's a contact page on a public website. No login is required, and as such, no sessions are maintained in any way, shape or form at this point.

The destination email is retrieved from the database, and only known internally by the mail servlet. People using this form can only provide their name, reply email address, subject and message.

The form basically is constructed as such, where Mail is my servlet:
16 years ago
JSP
Hi,

First off, I'd like to apologise if this isn't the appropriate forum to present my problem. Basically, I have a form on a jsp page that posts email information to a servlet, that sends email using JavaMail.

My problem is that it's just a form, and there is nothing to prevent the form from being abused. The destination email address is fixed and only known to the servlet, I'm mainly concerned about people sending mass email through this form with no way of preventing it.

I was thinking of making a verification image, perhaps by using JCaptcha, and was wondering if that was the best way to go about securing a form like this? Or, are there easier alternatives to get the job done?

Thanks,
Jason
16 years ago
JSP