Results 1 to 8 of 8
  1. #1
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Smile 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 05:50 AM.
    freedom exists in the world of ideas

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    I got it.....
    freedom exists in the world of ideas

  3. #3
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    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,
    sukatoa
    freedom exists in the world of ideas

  4. #4
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Thumbs up use ByteArrayOutputStream

    Quote Originally Posted by sukatoa View Post
    It is a fact that the jarred javabean can't read text file beside on it under the WEB-INF,
    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.

    Quote Originally Posted by sukatoa View Post
    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.....
    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();//

    Quote Originally Posted by sukatoa View Post
    The Location for that should be inside the JSP Container, but i don't know where specifically to put that file....
    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.

    Quote Originally Posted by sukatoa View Post
    Anybody knows about this? please reply....

    waiting,
    sukatoa
    Try:

    ByteArrayOutputStream (Java 2 Platform SE 5.0)
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  5. #5
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    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...

    sukatoa
    freedom exists in the world of ideas

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default interim progress

    Quote Originally Posted by sukatoa View Post
    Thanks for your reply Jordan,
    I prefer to be called Nick in routine conversation, I enjoy your efforts and this is minor.
    Quote Originally Posted by sukatoa View Post
    I still have to study the core of JSP following the Servlets.
    Read Marty Hall, or look at their website. Spend some time on it.
    Quote Originally Posted by sukatoa View Post
    I also need to grasp the server-to-client and vice versa System
    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.
    Quote Originally Posted by sukatoa View Post
    Actually post #3 is a bad idea....
    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.
    Quote Originally Posted by sukatoa View Post
    And now, i've solved my problem.....
    Which problem? Selection of initial design avenue?
    Quote Originally Posted by sukatoa View Post
    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....
    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.
    Quote Originally Posted by sukatoa View Post
    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))
    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.
    Quote Originally Posted by sukatoa View Post
    Can other users also able to use that instance?(from other browser,workstation,etc) or another instance will be created?
    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?

    Quote Originally Posted by sukatoa View Post
    I've planned to use the scope "session" to be able to handle his name until the browser is closed....
    Use forms.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Which problem? Selection of initial design avenue?
    I have resolved my problem about the text-file to be used as a source of data....

    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

  8. #8
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default you can have some of my purpose

    Quote Originally Posted by sukatoa View Post
    I have resolved my problem about the text-file to be used as a source of data....
    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.

    Quote Originally Posted by sukatoa View Post
    This must be crazy..... I realize that doing such thing with respect to its minimal purpose is really a bad idea....
    I have some to unload, you can have some of mine.

    Quote Originally Posted by sukatoa View Post
    So, i stored all the content of that text file into a database....
    ?

    Quote Originally Posted by sukatoa View Post
    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 is done all the time during development, we may have issues on getting enough people interested in actually looking at our page.
    Quote Originally Posted by sukatoa View Post
    It can be, but a very dangerous thing.....
    If real people and real money involved, can be too dangerous. We study simple sample for now.
    Quote Originally Posted by sukatoa View Post
    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....
    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

  1. Just getting started with java
    By DuceDuceExplorer in forum Introductions
    Replies: 4
    Last Post: 06-29-2008, 07:13 AM
  2. Applet not getting started
    By Preethi in forum New To Java
    Replies: 0
    Last Post: 05-27-2008, 04:43 PM
  3. How do I get started?
    By programmer-in-training in forum New To Java
    Replies: 4
    Last Post: 01-11-2008, 08:45 AM
  4. Getting Started
    By Doorsmaniac in forum Java Applets
    Replies: 0
    Last Post: 11-24-2007, 04:40 AM
  5. I need help getting started
    By Android in forum New To Java
    Replies: 2
    Last Post: 10-30-2007, 05:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •