Results 1 to 8 of 8
Thread: JSP Getting Started.
- 07-04-2008, 04:42 AM #1
JSP Getting Started.
This is my first time to post in this Section....
( JSP First timer )
I need your suggestions about initialising bean(in a jar)....
Im using tomcat....
In class, we should put that in WEB-INF/classes right?
In jar, we should also put them in WEB-INF/lib/
Now, in JSP Actions (instantiating a compiled javabean),
Directory: ROOT/WEB-INF/classes/com/Checker.class
<jsp:useBean id="Checker" scope="page" class="com.Checker" />
Is this correct?
Again, in JSP Actions:
instantiating a Jarred javabean is i don't know, and have no idea about
this.... (I did search on the web, only classes are in there tutorial, no jarred classes)
Who can show me an example here?
I mean, how to access the compiled jbean that was jarred?
Im looking forward on your replies,
PS. Im using notepad and a commandline here.....Last edited by sukatoa; 07-04-2008 at 04:50 AM.
freedom exists in the world of ideas
- 07-04-2008, 05:24 PM #2
I got it.....
freedom exists in the world of ideas
- 07-12-2008, 03:59 PM #3
It is a fact that the jarred javabean can't read text file beside on it under the WEB-INF,
Now, i would like to know where to put that text file so that i could read its content and pass it to another jsp that will be manipulated by JavaScript.....
The Location for that should be inside the JSP Container, but i don't know where specifically to put that file....
Anybody knows about this? please reply....
waiting,
sukatoafreedom exists in the world of ideas
- 07-13-2008, 05:51 PM #4
use ByteArrayOutputStream
In general, place a jsp out in the base dir, we should be able to place jsp's in ???-INF -> I tried that already and it works. What the design that seems to be evolving is place a dot jsp like an index file or normal static html - be though it may supporting server-side includes - and have the jsp pass to a Servlet. I was trying to grasp how this bean stuff works a few days ago, it is the paradigm, and went back to hardcoding jsp that passes to a Servlet. I did grasp that a bean may be populated from the query string, auto-type matching and no-fail on value not present.
Can it go in a Servlet? Is the text file a session variable? Some sort of static data or server- side information? JSP's have a server-side include that will read in the contents of a file ( I guess in the same directory ) and just feed it into the output stream going to the browser as though one had done a file.open();//
Right alongside the jsp, probably. If it needs to be protected, it can be placed in WEB-INF or META-INF and a get/post cannot touch it. Only the server and your code.
The standard server configuration can find things under WEB-INF && META-INF transparently, but browsers cannot.
Try:
ByteArrayOutputStream (Java 2 Platform SE 5.0)Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-17-2008, 02:37 PM #5
Thanks for your reply Jordan,
I still have to study the core of JSP following the Servlets.....
I also need to grasp the server-to-client and vice versa System....
Actually post #3 is a bad idea.... ( Some says incuding my instructor )
They advice me not to do it like what i thought, instead i have to code it or put it on the database.....
And now, i've solved my problem..... Thanks for you reply Mr. Jordan, i got some idea from your reply....
Now, i wan't to create a simple implementation of "ServerSideCookie" I like that term, i don't know if it was already exists or not, but my purpose is for handling the user's name that to be used for all the pages that he might try to visit....
I doubt about the logic,
Please correct me if im wrong,
If im signing-in on the sign-form, successful, then exploring on the sub-directories, (after signing-in, i will store his/her name on that instance(bean))
Can other users also able to use that instance?(from other browser,workstation,etc) or another instance will be created?
I've planned to use the scope "session" to be able to handle his name until the browser is closed....
Please do correct me about my phrases above if there is/are incorrect thoughts/ideas...
sukatoafreedom exists in the world of ideas
- 07-17-2008, 05:36 PM #6
interim progress
I prefer to be called Nick in routine conversation, I enjoy your efforts and this is minor.
Read Marty Hall, or look at their website. Spend some time on it.
The whole client/server is a design paradigm, a way of thinking about the code. That model has become popular and is effective when used by masters, but is definitely not the only way to do it.
The why of the matter is what matters. ( no pun intended ) Beans and databases are something you will run into again and again as that's the way they do it. Keeping your session info in a store of your own design makes transitioning to Beans and JDBC better to do.
Which problem? Selection of initial design avenue?
Cookie is not a bad term for starters. What you describe here is implemented already: : Interface HttpSession
My approach is to generate cryptographic grade keys ( ftr - DES just for throwaway sesssion keys ) and try to check these against the Server's Session ~ maybe not a good approach but to do any database anything I do not rely on ready-written code. In paticular, I was reading yesterday for the second time how RequestObject.isNew() does not behave as first time coder expects. IOW if(session.isNew()){}else{} will return session in progress even though one is - from the coders point of view - an expired session.
Bean has some place in grabbing the query string. I do not know what it is yet or how to use it. http has a 'Basic Authentication' which one would expect relies on cleartext, trying to authenticate before shipping something to an actual database is well studied, but not easy to do in a reasonable and robust manner. It all gets down to key control.
Who controls the controllers?
All we can do, and it is established practice, is keep good records and let the people that own the machine have detailed information if they need it. Protecting that information from tampering is only possible on Server Side. There we have an ideal place for Client/Server data model to provide us some guidance.
The voice of experience speaks in moderate tones.
That would be some fancy footwork, I already have to do that in a challenging environment. Consider the The Barn Cat. How would Felis catus ( a cat ) keep the sessions mixed and matched?
Use forms.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-20-2008, 01:13 PM #7
I have resolved my problem about the text-file to be used as a source of data....Which problem? Selection of initial design avenue?
This must be crazy..... I realize that doing such thing with respect to its minimal purpose is really a bad idea....
So, i stored all the content of that text file into a database....
As i imagine the process of deploying a web application that uses database, no one will attempt to use a page just to initialise all the settings from web container to server set-up....
It can be, but a very dangerous thing.....
So, speaking on my problem about accessing text-file inside the web-inf/xx, i assumed and set my mind that this must first be set-up before deploying....
Thank you very much Mr. Nick,
sukatoa.freedom exists in the world of ideas
- 07-21-2008, 02:08 AM #8
you can have some of my purpose
They can be source or sink, we can as well have a few other file types or design our own. Some earlier work will advise not to use hardcode special number to identifiy the file. We can write "474urjfjfhru483483iki" at the front of the file to identifiy it. Many ways available. All very well known.
I have some to unload, you can have some of mine.
?
It is done all the time during development, we may have issues on getting enough people interested in actually looking at our page.
If real people and real money involved, can be too dangerous. We study simple sample for now.
I just got an answer to that, see reply to my post in Database - Java Forums
masijade have reply for me right now. Master very smart, share the nectar of wisdom.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Similar Threads
-
Just getting started with java
By DuceDuceExplorer in forum IntroductionsReplies: 4Last Post: 06-29-2008, 06:13 AM -
Applet not getting started
By Preethi in forum New To JavaReplies: 0Last Post: 05-27-2008, 03:43 PM -
How do I get started?
By programmer-in-training in forum New To JavaReplies: 4Last Post: 01-11-2008, 07:45 AM -
Getting Started
By Doorsmaniac in forum Java AppletsReplies: 0Last Post: 11-24-2007, 03:40 AM -
I need help getting started
By Android in forum New To JavaReplies: 2Last Post: 10-30-2007, 04:46 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks