Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

steve dowdall

Ranch Hand
+ Follow
since May 23, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 steve dowdall

Hi,
I'm trying to understand Struts. Most of the examples I see are using other servers. Does anyone have a simple example that works on Weblogig 6.0? Simpler the better, I'm just starting.
Steve
20 years ago
Hi,
I have a Site1 and a Site2. Site1 is hosted, Site2 is registered (has dns servers set up), but not hosted. I want to check the referring URL/IP when someone visits Site1. If they came from Site2 I will redirect them to another page within Site1. Can I do this, if so what server variable do I check for (the DNS Servers perhaps)? OR does Site2 have to be hosted and resovle to an IP to be used in this fasion?
Thanks,
Steve
Can someone tell me in laymans terms what Struts is and why i would want to use it? The same thing for WAF (Web Application Framework). There is a lot of abstract explanations out there. Just want the plain vanilla version please.
Thanks,
Steve
20 years ago
I found the error.
It was a due to a bad try/catch block that was not allowing the remote interface to be created. After a little house keeping it works great. This is my first attempt at connecting a jsp/servlet/ejb and fully implemting the MVC architecture.
Thanks to all those who encouraged me the past week. Now on to those enhancments........
Steve
20 years ago
Ok, thanks to all you guys I have the servlet calling out to the ejb from the servlet. The ejb lookup and method calls are in a processRequest method that is called from the doGet method.
Tracing it i find that it gets past the InitialContex and the lookup, It gets to the ejb.home.create() and gives a NullPointer Exception. Like this:
getting ready to create()
<Nov 14, 2001 5:16:43 PM EST> <Error> <HTTP> <[WebAppServletContext(392716,DDMWebApp)] Servlet faile
d with Exception
java.lang.NullPointerException
at com.document.DocServlet.processRequest(DocServlet.java:181)
at com.document.DocServlet.doGet(DocServlet.java:280)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:12
65)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1631)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
Not sure why. I can hit the ejb from my java client and it works ok.
Any suggestions where to look or how to pin point it more?
Steve
20 years ago
So if i use my processRequest method to do the lookup for my ejb, your saying I should call it from the doGet()? I thought I could do everything in the processRequest method. I'm confused about what these methods do. Are these methods both called automaticaly in the Servlet? Do they have to be? I dont think I can put ejb lookup code in the doGet method because it does not like the exceptions that I have to catch.
Steve
20 years ago
Hi, I have a servlet that goes into the init() method and then does not execute any other methods. Here is the init():
public void init(ServletConfig config) throws ServletException {
super.init(config);
System.out.println("inside init()!");
}

Am I missing something here? When I run it in Weblogic, I can see the invocation and it prints out the "inside init()" but then nothing else happens. My processRequest() does not execute.
Anyone know why?
Steve
20 years ago
Hi,
I have a jsp that calls a servlet. It works.
Ok, then I modify the servlet code a bit, nothing major. I take the class file, put it into my .war file (overwriting the original servlet.class file) and put that into my ear. Not my ear really, my .ear file.
The error I get from the Weblogic server confuses me, it states:
javax.servlet.ServletException: Servlet class: 'com.mycompany.document.DocServlet' could not be lo
aded - the requested class wasn't found in the classpath: 'C:\bea\wlserver6.0\config\mydomain\appli
cations\.wl_temp_do_not_delete\wl_local_comp62980.war;C:\bea\wlserver6.0\.\config\mydomain\applicati
ons\.wl_temp_do_not_delete\WEB-INF\_tmp_war_myserver_myserver_MyWebApp'
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:532)
If I copy the old servlet back in to the .war it works fine. What is all this tmp folder stuff? Can't I just modify a java file, compile it and put the class file in the .war file??? If not, what is the best practice if you have to modify a servlet and then get the newer version of servlet to work in Weblogic?
Steve
20 years ago
Thanks a bunch!
20 years ago
Thanks Kyle,
Yup, SSB is what we are talking about. Per your suggestion I'll put it in a service method instead of the init(). Do you have a snippet of code perhaps that I would use to do the ejb lookup from this method?
Steve
20 years ago
Hi,
I have a servlet that will call an ejb. I need to find two things:
1. the code to put into the servlet to do the lookup for the ejb.
2. should I put that lookup code into the init() of the servlet and then call my business methods from another method in the servlet?
Thanks,
Steve
20 years ago
Excellent. I'm grateful that people are willing to help each other
Thanks.
thanks,
the two parameters (employeeid and doctype) are being used by the ejb to do some table look ups and inserts for a document generation system. I have decided to go with a jsp page that collects the form data from the user and sends it via the query string to a servlet. The servlet will be the controller and do the look up and create() on the ejb. Based on a return value from the ejb, the servlet will generate a pass or fail html page bacj to the user. Round trip completed.
Any input appreciated....

Steve
Can someone please give me a simple answer to this.
I have an EJB deployed on weblogic. Works great. I have a stand alone java client accessing the ejb. That works great too.
What I want to do know is run a client from a browser that uses the EJB. I have seen so many different ways of explaining it, it makes me dizzy.
I will need to collect two variables from the user. Should I put put the ejb create() code on the JSP? Should I use a servlet, if so for what? Should I simply use an html form and then call a servlet?
If someone can simplify this as to what the best practice is for performace and scalablity when doing something like this I would appreciate it. I'm sure I'm not the only one.
Cheers,
Steve
Hi,
I'm calling an ejb from my jsp. Since I need to get an employee ID and a Doctype variable from the user, I will use a combobox and a textfield. I will retreive the variables and pass them to the business method for the ejb. My question is since I have to use an html form to get my user's info, what does the form action have to be set to so that when they hit the submit button it runs the EJB?
Steve
20 years ago
JSP