Darrell Henry

Greenhorn
+ Follow
since Mar 06, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Darrell Henry

(better late than never!) I was searching the forum for an answer to this question because I have been experiencing the exact problem. It turned out to be related to my Zip Drive.
I recently had my operating system reinstalled and had to reconfigure all of my applications.
To make a long story short, I needed to place a disk in my Zip Drive in order for the error to disappear.
What helped completely remove the error was to give my Zip Drive a new drive letter designation. For example, changing from "E:" drive to "Y:" drive using the system tools made the problem go away without the need of putting a disk in the drive.
I know this response is several months LATE. However, I wanted to post what solved my problem in order to, hopefully, assist someone in the future.
ciao!
- Darrell
22 years ago
Hey! I'm going to celebrate. My wife planned a suprise vacation for us. She booked a 4 day cruise to Key West, Florida and Cozumel, Mexico!
She knew that we would need a little break after all of the cramming. She said whether I passed or not, we were going ... So, this trip turns out to be one of celebration rather than consolation
We leave tomorrow - c-you when we get back!
take care -
23 years ago
EVERYTHING I expected, thanks to the INVALUABLE input from fellow Ranchers.
My preparation went as follows:
Marcus (before JQ+, test#2:57%,60%; after JQ+, test#1: 77%)
JQ+ (after 14 standard tests, last three random tests, in order: 70%,65%,71%)
RulesRoundup: 100% (every day for past 5 days)
Books: RHE
Looking at my above scores, I'm not surprised with my final score.
I have been toying with Java for the past year or so (been desiring to get into it for some 4 years now).
Over the summer, I ripped apart a JSP project from "Web Development with Java Server Pages", Fields/Kolb, and put it back together, customizing it for a personal project. Put it on the shelf and kind of went dry for a couple of months.
I seriously starting preparing for the exam exactly one month ago, using RHE and other fine resources from this site.
I obtained JQ+ two weeks ago. Looking back, I wish I could have obtained this product several months ago, maybe my score would be higher - but, hey, they lived up to their guarantee - I passed! It revealed my weak areas and allowed me to zero in.
The company I work for will be undertaking a huge project in the coming months: Converting major sections of a Lotus Notes/Domino application to a relational back-end database (possible Websphere/Oracle combination). Looking forward to that.
About the content of the exam: Check out this link. Shivaji breaks it down well.
Shivaji describes my exam precisely. Yeah, I/O and threads all over the place. I got the ONE GridBagLayout too. All things considered, No walk in the park for me this time around.
Tips:
  • You'll hear this one all the time - Write and compile code (at least small snippets) - it works! Cut and paste is your friend. It clears the fog.
  • Mocks - do 'em. As many as you can. I wish I could have ... trains the eye.
  • Get a good grasp of each objective before jumping into the mocks. I hadn't finished RHE before I started taking the mocks - a LOT backwards. I was attempting a parallel effort. I crammed hard for this.


  • My goal with any certification is to open my eyes to various facets of the topic at hand. Allow me to see what the possibilities are, instead of focusing solely on one aspect - and then proceed in an informed manner.
    Looking forward to enhancing what I've learned thus far and SCWCD ... thanks, again, folks.
    ciao,
    23 years ago
    Take heart Raji
    You have recognized what and how you need to focus going forward. With the right approach - including as much CODING as you can - you'll do better next time. Keep your chin up!
    [ January 08, 2002: Message edited by: Darrell Henry ]
    23 years ago

    Originally posted by sriram tatavarthi:
    Can any one help in how do i upload a file ( any document type ) to the server? iam perticularly intreseted in sevlets, java beans, jsp etc.
    thanks for the help


    Sriram, this is a topic that has been covered extensively within this forum. Try searching the forum on "file uploading" or "uploading", or check out this link. Hope this helps!
    much success,
    Darrell
    [This message has been edited by Darrell Henry (edited September 20, 2001).]
    23 years ago

    Originally posted by Mike Curwen:
    [B]Well Darrell,

    I gotta hand it to you, that's a heck of a chunk of code you wrote.

    I've never seen anything quite like it.. (ie: "what's a command?")

    Anyways.. the problem is maybe related to your overriding the service method? In the API it says :

    Part of the problem of writing code in the service method is that you don't know yet if the request is post'ed or get'ed, if you'll forgive my use of English. the provided impl of service will shuffle off these two request types to the two doXXX methods, and so that's how you can determine a file upload request. If you are doing a multi-part request, you are definately posting. So in the doPost method, you'd immediately call your multipart request processing, and THEN examine the post for your 'cmd' parameter.

    Does that make sense?[/B]



    Made a TON of sense! Thanks so much! You helped me solve my problem. The key was, as you stated, "maybe related to your overriding the service method". Here is what I ended up doing:
    Used both the doGet and doPost classes instead of the service class. I have the doXXX call their own respective functions. This works fine, because the application is driven by "posting" forms. If a "get" request is submitted, most likely it should be directed back to the default, welcome page. I still need to tweak this for the exceptional cases. I can probably clean this up a little better, but, at least I'm on track now.
    BTW, a "command" is an interface used throughout the application:


    Here are the changes I made:


    Thanks Mike. I appreciate your assistance.
    - Darrell
    23 years ago
    I'd like to make it easier on you kind folks out there. I'll attempt to simplify my question. I guess I see so many posts lacking info, maybe I overdid it.
    Here's the "cliff notes" version:
    What exactly does the HttpServletRequest actually see when absolutely nothing is submitted via the URL as opposed to when parameter values, etc. are submitted?
    My "director" servlet tests for two conditions (handles all requests):
    1. A valid value returned from a "cmd" parameter: req.getParameter("cmd")
    If it returns something, it performs the necessary functions
    2. A "null" "cmd" value. Indicating that a form was submitted via MultipartRequest or the user pressed enter at the URL without any parameters (parsing is necessary).
    In either case (in 2 above), there's only one class that parses until it finds the appropriate "cmd" value, then responds. However, if the user just presses "enter" at the URL with no values, the class that handles the MultipartRequest should see that "cmd" never existed and should simply take the user back to the "welcome page". Instead, it just sits there displaying "Opening page at http://localhost:8080/addtool ..." for an INDEFINITE period of time.
    Otherwise, it works properly when a true form is submitted with an attachment.
    Thanks, again.
    - Darrell
    23 years ago
    Manoj,
    The only successful way I've found to deal with this is to write code to "examine" the line before you attempt to use any of its contents for populating a database (someone correct me if I'm wrong).
    It's long and tedious, I know - and not pretty! See my earlier post. I'm doing something like this: look at the "DoPost" pasted in code.
    Basically, you will need to find the position of each delimiter in your line (String.indexOf('~')), use the return value as an offset while locating the next delimiter. Based on the index position of the next found delimiter, you should be able to determine if there was something between the two (because you know the position of the first!).
    If the results indicate that no value exists between your delimiters, then you can actually set the variable that was supposed to hold the returned value to "null" or some other appropriate value.
    Let me know if this makes sense.
    Regards,
    - Darrell
    23 years ago
    Anubha,
    I think I might have an idea about what you're trying to accomplish. However, a little code will help. Can you include snippets from your JSP and/or servlet?
    What exactly do you mean when you say:


    ( this applet comes in jsp only when the hyper link is clicked)



    Thanks,
    - Darrell
    [This message has been edited by Darrell Henry (edited September 19, 2001).]
    23 years ago
    I would like to thank everyone who participates in this forum. This has been an extremely valuable resource for me and many others. I look forward to one day contributing suggestions and comments as I become more knowledgeable.
    Here's my recent challenge:
    I have a servlet (AddAdminServlet) who's context path is "/addtool". This servlet is the heart of my application. ALL requests are sent to this servlet and it determines the actions to take and the next page to display. Under normal conditions, if the servlet was invoked WITHOUT sending any parameters (via the URL or a submitted from), the servlet would set the appropriate variables and the user would end up at the designated "welcome page" (see code below).
    Here was the dilemma: I've recently added functionality for my application to handle MultipartRequest (for file uploading). I discovered, rather quickly, that when submitting MultipartRequest there was no straightforward way of "grabbing" the parameters which were submitted with the form, even though they were present (e.g. req.getParameter("cmd") would return a null value). I realized that I would have to parse the request to find the desired values. I wrote the code to do all of my parsing, access the database, create the entries, handle the errors, etc. It works fine (I was kinda proud of myself!). BTW, that servlet was being tested having its own context path, say, "/dopost", for example.
    I didn't want it in its own context path because I wanted to call it from the heart of the application, AddAdminServlet. I made the necessary changes and integrated the DoPost into the rest of the application.
    Now, my reasoning was, when the AddAdminServlet receives a request where the parameter value "cmd" is null ( req.getParameter("cmd") ) it must be a MultipartRequest, call DoPost, if a file is not present or the desired format, or any other non-desirable scenario let DoPost set the appropriate variable and return the user to the "welcome page".
    Here's the PROBLEM: When firing up my test environment for the first time (TomCat 3.2) and entering "http://localhost:8080/addtool", the page just sits there displaying "Opening page at http://localhost:8080/addtool ..." for an INDEFINITE period of time.
    The application now only works if I enter: "http://localhost:8080/addtool/?cmd=main-menu" which accesses the "welcome page". Once I've accessed that page, I can navigate fine. Functionality returns to normal, including file uploading (MultipartRequest), etc. Wonderful.
    The goal with this application was to have "http://localhost:8080/addtool" in the URL at all times. This was achievable until I recently directed DoPost to handle all null "cmd" values.
    I must add that once I am "in" the application, entering "http://localhost:8080/addtool" in the URL and pressing "enter" goes back to "Opening page at http://localhost:8080/addtool ..." for an INDEFINITE period of time.
    It appears to me that my DoPost can only handle legitimate MultipartRequest and "freezes up" when it receives a URL without ANY parameters?
    Any thoughts?

    HERE IS THE AddAdminServlet CODE:

    HERE IS THE DoPost CODE (ONLY FOR REFERENCE!):
    23 years ago
    No success on this one. Letter case is consistent throughout.
    If any one else would like to try this project, you can get the source at:
    http://www.manning.com/Fields/Source.html
    Again, its the "faqtool" example application.
    take care,
    Darrell
    24 years ago
    Thanks for the tip. I'll keep digging ...
    - Darrell
    24 years ago
    Good day!
    I, honestly, have been searching the posts all day and digging through various reference material ...
    I am trying to build the example JSP project (FAQ) provided in "Web Development with Java Server Pages" by Duane K. Fields and Mark A. Kolb. I am learning a GREAT deal from this book! And a lot more from this site!!
    When launcing the URL:
    http://localhost:8080/faqtool
    I am presented with the directory listing rather than launching a servlet that should present me with a JSP page. I understand that the URL is not to change when navigating through this application???
    Additionally, clicking on some of the JSP pages in the directory will result in the error:
    2001-03-06 03:27:50 - Ctx( /faqtool ): JasperException: R( /faqtool + /all.jsp + null) Unable to load class FaqBean
    I have ensured that my PATH, CLASSPATH, etc., variables are set correctly.
    CLASSPATH = C:\jdk1.3.0_02\lib;C:\j2sdkee1.3\lib;C:\foo\tomcat;
    C:\IBM Connectors\classes;C:\IBMCON~1\CICS\Classes\CTGCLI~1.JAR
    J2EE_HOME = C:\j2sdkee1.3
    JAVA_HOME = C:\jdk1.3.0_02
    Path = C:\jdk1.3.0_02\bin;C:\j2sdkee1.3\bin;C:\IBMDebug\bin;
    C:\IBM Connectors\Encina\bin;
    C:\IBMCON~1\CICS\BIN;%SystemRoot%\system32;%SystemRoot%;
    %SystemRoot%\System32\Wbem;C:\Program Files\Symantec\pcAnywhere;C:\IMNnq_NT;C:\foo;C:\IBM;
    TOMCAT_HOME = C:\foo\tomcat
    The actual Tomcat/FAQ app file path:
    C:\foo\tomcat\webapps\faqtool\WEB-INF\classes\com\taglib\wdjsp\faqtool
    "faqtool" contains all of my class files.
    I have created the appropriate directories for the class files, configured the server.xml (for Tomcat) and the web.xml (for the FAQ app), but still can get this thing to work.
    SERVER.XML (typical settings excluded):
    .........................................................
    <Context path="/faqtool"
    docBase="webapps/faqtool"
    isWARExpanded="true"
    crossContext="false"
    debug="0"
    reloadable="true" >
    </Context>
    .........................................................
    WEB.XML:
    .........................................................
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
    <web-app>
    <display-name>Web Development with JSP</display-name>
    <servlet>
    <servlet-name>faqs</servlet-name>
    <servlet-class>com.taglib.wdjsp.faqtool.FaqServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>faqtool</servlet-name>
    <servlet-class>com.taglib.wdjsp.faqtool.FaqAdminServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>faqs</servlet-name>
    <url-pattern>/faqs</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>faqtool</servlet-name>
    <url-pattern>/faqtool</url-pattern>
    </servlet-mapping>
    </web-app>
    .........................................................
    Here is the FaqAdminServlet code:
    .........................................................
    package com.taglib.wdjsp.faqtool;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class FaqAdminServlet extends HttpServlet {
    private HashMap commands;
    private String error = "error.jsp";
    private String jspdir = "/jsp/";

    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    initCommands();
    }

    public void service(HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException, IOException {
    String next;
    try {
    Command cmd = lookupCommand(req.getParameter("cmd"));
    next = cmd.execute(req);
    CommandToken.set(req);
    }
    catch (CommandException e) {
    req.setAttribute("javax.servlet.jsp.jspException", e);
    next = error;
    }
    RequestDispatcher rd;
    rd = getServletContext().getRequestDispatcher(jspdir + next);
    rd.forward(req, res);
    }
    private Command lookupCommand(String cmd)
    throws CommandException {
    if (cmd == null)
    cmd = "main-menu";
    if (commands.containsKey(cmd.toLowerCase()))
    return (Command)commands.get(cmd.toLowerCase());
    else
    throw new CommandException("Invalid Command Identifier");
    }
    private void initCommands() {
    commands = new HashMap();
    commands.put("main-menu", new NullCommand("menu.jsp"));
    commands.put("abort", new AbortCommand("menu.jsp"));
    commands.put("add", new NullCommand("add.jsp"));
    commands.put("do-add", new AddCommand("menu.jsp"));
    commands.put("update-menu", new GetAllCommand("upd_menu.jsp"));
    commands.put("update", new GetCommand("update.jsp"));
    commands.put("do-update", new UpdateCommand("menu.jsp"));
    commands.put("delete-menu", new GetAllCommand("del_menu.jsp"));
    commands.put("delete", new GetCommand("delete.jsp"));
    commands.put("do-delete", new DeleteCommand("menu.jsp"));
    }
    }
    .........................................................
    Here is the FaqBean code:
    .........................................................
    package com.taglib.wdjsp.faqtool;
    import java.util.Date;
    public class FaqBean {
    private int id;
    private String question;
    private String answer;
    private Date lastModified;
    public FaqBean() {
    this.id = 0;
    this.question = "";
    this.answer = "";
    this.lastModified = new Date();
    }
    public void setQuestion(String question) {
    this.question = question;
    this.lastModified = new Date();
    }
    public String getQuestion() {
    return this.question;
    }
    public void setAnswer(String answer) {
    this.answer = answer;
    this.lastModified = new Date();
    }
    public String getAnswer() {
    return this.answer;
    }
    public void setID(int id) {
    this.id = id;
    }
    public int getID() {
    return this.id;
    }
    public Date getLastModified() {
    return this.lastModified;
    }
    public void setLastModified(Date modified) {
    this.lastModified = modified;
    }
    public String toString() {
    return "[" + id + "] " + "Q: " + question + "; A: " +
    answer + "\n";
    }
    }
    .........................................................
    This problem is particulary perplexing because I am able to compile and use other classes within the Tomcat environment.
    I just can't seem to get this project off the ground.
    I hope that all of this text didn't scare everyone away. This is my first posting. I just wanted to be sure to include as much pertinent info as possible. Thanks in advance!
    Darrell
    Future SCJP

    I edited the classpath to keep this from pushing off the side of the page. The classpath is still complet but, appears on multiple lines ---Carl
    [This message has been edited by Carl Trusiak (edited March 07, 2001).]
    24 years ago