Jia Bin Tang

Greenhorn
+ Follow
since Mar 06, 2008
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 Jia Bin Tang

ujjwal soni wrote:Hi,

The code seems to be working. Well, here are the answers to your questions.

1) How to I change this to datasource?

A) You can create a datasource by clicking on startmenu -> run -> type odbcad32.exe
If you are having an existing datasource then simply change the bolded word with the name of your datasource

connect=DriverManager.getConnection("jdbc:odbc:MyDataSource","sa","");




Oh sorry dude, what I meant was this: connecting using with JNDI as well. say like:




possible to use this (datasource) method? If so, how?
Anyway thanks for answering the other qn.
15 years ago
JSP
I happened to see this code from one of the books "Making use of JSP", and is sort of what I need for the login bean for my java page:



One qn I'd like to ask: How to I change this to datasource? As I've been using datasource for my project, so I'd like to keep it constant.


Oh ya, and can someone interpret, what does this line means?



Thanks a million!
15 years ago
JSP

Ankit Garg wrote: There must be no scripting in JSPs.



Hi, sorry for reviving old thread again, but I don't quite understand this part.
I saw some books that even writes the business logics on the JSP page itself (though I don't prefer to do that).
15 years ago
JSP

ArAsh Dex wrote:Mr/Ms Campos Teixeira
I'm new in JSP and JSF too
but i think your solution is not cool

I think it's better that use JPA (an entity bean) for Database connection with a simple JSP page with JSTL or a servlet

it's really cool and secure use JSF for authorizing users

good luck mi amigo



My solution is based on school's requirement, that we try not to use entity bean. If there isn't such a rule, I'd have used EJB long ago.
15 years ago
JSP
Nobody wants to help me on this?
15 years ago
JSP
Hi Mr Ankit Garg,
I'd like to do something like that on my cart page:



I've tried using this



but it doesn't seem to work, it gives an error message (resource not found) . I always end up getting the medicine ID and the quantity.
Anyway my school project suggests this:

Information used by several HTML/JSP pages (i.e. the shopping cart) should be stored in the session object. It should not be stored in hidden fields and posted from page to page.

What is the thing that I need to do before using this:



Thanks.
15 years ago
JSP

seetharaman venkatasamy wrote:

Jia Bin Tang wrote: I'm not using MVC 2 Model



There is no such thing called MVC2 . Model2 design is nothing but MVC



Haha I see, I always thought it's something got to do with struts framework though.
Thanks for correcting.
15 years ago
JSP

Ankit Garg wrote:I am talking about this thing

<FORM ACTION="dispatcher" METHOD="POST">

There must be a servlet mapped to dispatcher URL, just post the code of that. If you can't, then it's simple to do if you understand my instructions. Your page will give you the quantity and ID of the medicine. You can take that to get the medicine that the user chose and add it to the session as an attribute. To do this I would recommend that you build a List and add it as an attribute to the session. Whenever a new item is added to the cart, just take out the list from the session and update it. I think you'll understand what I am trying to say...



I see. I'm not sure if this dispatcher servlet affects anything because it's a "universal" servlet that must be used to forward any JSP page.
It's a "rule" from school, we cannot post directly to a JSP page.

15 years ago
JSP

Ankit Garg wrote:Well I think you need to provide one more code and that is of the action which is handling the form of the first page. In the first page you have written the action of your form as dispatcher. You code for listEmp2.jsp is also wrong I think. There you have used an object order in line 48. But I can't find that object declared in the file. Also in line 74 you are using the object item but you have commented that object on line 97.



Hmms, which first page are you referring to? If you're referring to the first page, as in the previous page before that, then it's just:

which I felt is quite redundant to post. I kind of follow the script from JSPCart http://www.neurospeech.com/Products/JspCart.html And it has this:

Again, it looks quite similar to the one that I'm doing.

But because I use hidden values:


So it seems like the vector can only load quality and the Medicine ID into the next page.
We were suggested to actually use setAttributes() to bring the data over. How do I go about doing it?
Many thanks.
15 years ago
JSP

Bauke Scholtz wrote:There are too much and I am not motivated enough to point them all out.

But I would say, this one really, really, surprised me:


I can spot at least 5 (think)faults in here.



Hahah! I guess I'm not getting very logical here. I do a dummy copy and paste here and there, so I guess that's one of the reasons why it isn't correct.
I get the idea from here:



I don't understand this line as you put:


The other one was:



And due to the rule of using the dispatcher servlet, I can't use these servlets in my program.
15 years ago
JSP
I'm currently working on a school project that deals with shopping cart. I'm not using MVC 2 Model, Cos I don't learn struts and so things are getting complicated.
I couldn't seem to add any other items into the cart, other than the ID and the quantity. What should I do if I want to add the rest of the string from the data, i.e. unit Price and total price?

Here's the following codes in mind (will be quite long):

Or you can PM me if you want the whole set of files.

Thanks & regards.

This is the product JSP page:

The problem lies with this page:

The Java files:



DAO:



Data:
15 years ago
JSP

campos teixeira wrote:data04 is the bean myBean ok



I couldn't find any of the bean that is data04.

Anyway here is my code for the login bean:



I can't seem to do the log in even I have these files:

login:



Can someone tell me what is wrong with my codes? Need it urgently. Thanks.
15 years ago
JSP
Hi, I'm supposed to do an assignment that is related to the topics above. However I'm not sure if I've used the above correctly (as in, correct logically). The program should do the following:

- User enters whether he is client or property agent.
user enters info.

- If is property agent, user can
1) add property list,
2) view property list,
3) remove property list,
4) list property list.

you can view my codes here:

Main:
I'm trying to add information here. However, I'm not able to save information for the subclass. (i.e. Property Agent's info)
I've tried creating new person.client() but there's error.

http://www.geocities.com/jbtang2002/Assignment1.java
http://www.geocities.com/jbtang2002/Console.java


Property: I'm supposed to calculate commission here, but stuck in it.
http://www.geocities.com/jbtang2002/Property.java
http://www.geocities.com/jbtang2002/House.java
http://www.geocities.com/jbtang2002/Apartment.java

http://www.geocities.com/jbtang2002/Person.java
http://www.geocities.com/jbtang2002/Client.java
http://www.geocities.com/jbtang2002/PropertyAgent.java
16 years ago