comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * How to restrict direct access to JSP files, only allow access via servlet? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 * jsp <c:out> - question - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/25a37d7357bbaca7 * Efficient way of dynamically invoking a method that returns a primitive type? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 * http error - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e7f45257c8c36ca7 * swing JInternalFrame focus management - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a071968367d7dcc * Can Java Programmer Learn C++ Quickly? - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec * NoSuchMethodException when reflecting ServletContext as a parameter - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a447e67bb400d60c * JavaMail sending email with no body content - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cec1a6c35fb18e1 * HttpServletResponse - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f313cc803055284 * Anyone have any experience with WebLogic 8? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c2807943e7284e7d * Unable to establish a socket connection - Got it! - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49 * What is "not" instanceof - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fd588d2bb2c2804 * Java speed vs. C++. - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523 * Thoughtsworks Job Interview? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821 * ServletExec hangman.jsp example problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54268d21ea6231b2 * Tool or IDE for function inlining - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/58fb84c0ecba12f0 * URLencoder - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/74953a1a8483b844 * get and set Attribute for EJB Context (Storing objects) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ac27c0ee059670c ============================================================================== TOPIC: How to restrict direct access to JSP files, only allow access via servlet? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 12:53 pm From: "Ryan Stewart" "John C. Bollinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ryan Stewart wrote: >> From "Code Conventions for the JavaServer Pages Technology Version 1.x >> Language": >> "Third, we use the term JSP fragment to refer to a JSP page that can be >> included in another JSP page. ... JSP fragments can use either .jsp or >> .jspf as a suffix, and should be placed either in /WEB-INF/jspf or with >> the rest of the static content, respectively. JSP fragments that are not >> complete pages should always use the .jspf suffix and should always be >> placed in /WEB-INF/jspf." >> >> http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention/ > > I think "JSP fragments can use either .jsp or .jspf as a suffix, and > should be placed either in /WEB-INF/jspf or with the rest of the static > content, respectively" mixes up the recommended locations for .jsp and > .jspf files. In particular, it is not consistent with the next sentence > that specifies that certain JSP fragments should both have the .jspf > extension and be located in /WEB-INF/jspf. As a result, I think the > convention that is being conveyed is to put .jsp files "with [...] the > static content", i.e. _not_ under WEB-INF. > 1) JSP fragments that are not complete pages should always have a .jspf extension and go in /WEB-INF/jspf. This is not inconsistent with the previous statement. It is an enhancement of it. JSP fragments that are complete pages may be named with .jsp or .jspf and may be placed in the jspf folder or with other static content. 2) I agree that JSPs should generally go with other static content. This specification actually makes no recommendation that I see, either explicit or implied, as to where that should be, so I probably shouldn't have brought it in here in the first place. >> When using Struts, the idea is that all access to the application will go >> through Struts. Therefore, there is no need for any public JSPs. And in a >> sense, every JSP is being included, though not in another JSP. > > That's well and good, but not relevant to where the .jsp files should be > located relative to the webapp root. It's completely relevant given the definition of a JSP fragment and where said fragments are to be placed. > I happen to agree with Alan that JSPs that are complete pages and are > used as such should not be placed under WEB-INF. There are multiple > mechanisms available for preventing direct access to the JSPs; putting > them under WEB-INF is unnecessary, unconventional (according to my reading > of the Sun convention), and confusing. > Since this whole thread is supposed to be about preventing direct access to JSPs, would you mind sharing the mechanisms you mentioned? ============================================================================== TOPIC: jsp <c:out> - question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/25a37d7357bbaca7 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 12:56 pm From: "Ryan Stewart" "ctyberg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to re-write this line using c:out. > <%request.setAttribute( "view", session.getAttribute("EntityReport")); > %> > > I know that my object is there because the line below works. I see my > object's class name... > <c:out value="${sessionScope.EntityReport}"/> > > Then I assign it to the variable "view". > <c:set var="view" scope="request" > property="${sessionScope.EntityReport}"/> > > But then I can't see it anymore. The line below does not show the > object's class name. > View: <c:out value="${view}"/> > > Any ideas? > Try value instead of property in the set tag. == 2 of 2 == Date: Wed, Dec 8 2004 11:21 am From: "ctyberg" Thank you! It worked. Here's my next question. I want to get an object from the session, but I need to refer to the object by using a request parameter. How would I do it? <c:set var="varName" scope="request" value="${param.varName}"/> <c:set var="view" scope="request" value="${sessionScope.WouldLikeToPutVarNameHere}"/> ============================================================================== TOPIC: Efficient way of dynamically invoking a method that returns a primitive type? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:15 pm From: "Chris Uppal" Andreas Jakobik wrote: > is there an efficient way to dynamically invoke a method that returns > a primitive type? I'd like to avoid the Object to primitive type > conversion. Well, if you /really/ think its worthwhile, then you can do it very efficiently by generating a forwarding class on-the-fly. You'd probably want to use a byetcode library like BCEL, ASM, or the GNU Bytecode Library, to handle the tedious bits of bytecode generation. I doubt /very/ much whether it's worth it, though... -- chris ============================================================================== TOPIC: http error http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e7f45257c8c36ca7 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 8:02 pm From: "stud" i'm trying to compile next code, error: cannot resolve class sysmbol HTTP any suggestion? public interface ISpiderReportable { public boolean foundInternalLink(String url); public boolean foundExternalLink(String url); public boolean foundOtherLinks(String url); public void processPage(HTTP page); public void completePage(HTTP page, boolean error); public boolean getRemoveQuery(); public void spiderComplete(); } == 2 of 2 == Date: Wed, Dec 8 2004 7:16 pm From: Joona I Palaste stud <[EMAIL PROTECTED]> scribbled the following: > i'm trying to compile next code, > error: cannot resolve class sysmbol HTTP > any suggestion? > public interface ISpiderReportable { > public boolean foundInternalLink(String url); > public boolean foundExternalLink(String url); > public boolean foundOtherLinks(String url); > public void processPage(HTTP page); > public void completePage(HTTP page, boolean error); > public boolean getRemoveQuery(); > public void spiderComplete(); > } Yes. Be sure to include the class HTTP somewhere in your sources or classpath. If you don't have the class HTTP, or don't even know where to get one, then you're out of luck. -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-------------------------------------------------------- rules! --------/ "Stronger, no. More seductive, cunning, crunchier the Dark Side is." - Mika P. Nieminen ============================================================================== TOPIC: swing JInternalFrame focus management http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a071968367d7dcc ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 11:13 am From: [EMAIL PROTECTED] If that is the case I would be estatic. Do you have to do something to activate it? What makes you think this is done? I don't think there is an error in my code. I have a JFrame which holds a jdesktop pane in it's content pane and I add the jinternalframes to the desktop pane like so: desktopPane.add(aJInternalFrame); thanks ryan ============================================================================== TOPIC: Can Java Programmer Learn C++ Quickly? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec ============================================================================== == 1 of 3 == Date: Wed, Dec 8 2004 1:53 pm From: Chris Riesbeck In article <[EMAIL PROTECTED]>, James Kanze <[EMAIL PROTECTED]> wrote: > > ... IMHO, the library is a disaster in C++, but it > is very *in* to vault the STL. In practice, I'd say that you do have to > know the tradeoffs with regards to the containers (vector, deque and map > are the ones I use most often -- almost never list). On the other hand, > I've found very little use for most of the algorithms in practical code. > > ... > > Once the basic syntax is mastered, I'd strongly recommend Scott Meyers' > three books. The first one ("Effective C++"), particularly, addresses a > number of classical issues that you just have to know. For someone with Java (or C#) experience, I'd also recommend Koenig and Moo's Accelerated C++, because it quickly jumps into writing good clean modern maintainable C++ code, practically from page 1, making heavy use of the STL and some of those algorithms you've found little use for. == 2 of 3 == Date: Wed, Dec 8 2004 1:05 pm From: James Kanze Rene wrote: > James Kanze <[EMAIL PROTECTED]> wrote: >>Well written C++ isn't necessarily difficult, but it is different from >>Java. And while poorly written code is poorly written code in any >>language, C++ does seem to have a particular gift for encouraging it. > Ever seen perl code ? :-) Point taken. Perl makes C++ look like a model of simple elegance and readability. On the other hand, while Perl is significantly less readable than if average C++, it probably contains less traps for the unwary than C++. You might characterize Perl as a write only language -- it's not that difficult to get a somewhat working application, but God help the poor soul who has to read and understand it. Whereas C++ tends to other direction -- a well written C++ program can be a joy to read, but there are quite a few little things you have to know and to pay attention to to get there. And to get back on topic, I'd rate Java between the two, albeit much closer to C++ than to Perl. Well written Java is quite readable -- not as much as C++, but still, not bad. And while Java is lacking in many of the more basic things you need to write really robust applications (e.g. static linking, so you can test what your customer actually runs), things like garbage collection and a well designed set of libraries do mean just that much less that the programmer has to do. -- James Kanze home: www.gabi-soft.fr Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 9 pl. Pierre Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34 == 3 of 3 == Date: Wed, Dec 8 2004 1:38 pm From: James Kanze Ian T wrote: > James Kanze wrote: >> I've never found memory management to be a great problem in C++. And in >> the doubtful cases, you use some sort of smart pointer. > Right, but it's not something a Java (or VB) programmer would have > thought about. So for you it's no problem, but the OP asked the question > from the point of view of someone learning the language. I'd argue that this isn't true if he has been writing good Java. Garbage collection no, you do have to think about lifetime of object issues at the design level, as part of the design. In Java, most of the time, your work stops there. A quick evaluation, just to be sure that garbage collection IS adequate, and no real code to write, except in the exceptional cases (somewhere between 5% and 10%) where it for one reason or another, you do need determinist disposal. In C++, when you've handled the design aspects, your work has just started. BUT... if you get the design aspects right (which you should be doing in Java as well), most, if not all of the extra work is just grunt work -- it doesn't require much thought, and while it often requires more code than one would like, C++ does have several techniques, such as destructors, which make it actually superior to Java when you need determinstic disposal. >> It's a far cry >> from having garbage collection, and it IS one more thing you have to >> think about, but since at the conceptual level, you have to be concerned >> with lifetime of object issues anyway, it usually ends up to be just one >> more implementation detail. A bit of extra work, but not something >> difficult to get your head around. > No so much difficult as unforgiving. If you mean that a small mistake can do a lot of damage...:-) But that's the design philosophy of C and C++, isn't it? That programmers never make an error, so if they in fact do... >> Pratically, except for the absence of garbage collection, I don't seem >> much difference between C++ pointers and Java references. You can do >> more things with C++ pointers, and if you do, it can become difficult, >> but you don't normally worry about things like pointer arithmetic unless >> you are writing low level software, like a garbage collector. > IIRC, the containers use pointer arithmetic for iterators. It depends. Some of the containers have iterators which allow arithmetic which behaves somewhat like pointer arithmetic. All of those containers also support indexation, however, so once again, you're not obliged to do stupid things if you don't want to. When it comes down to it, of course, neither C++ nor Java can be taken as models with regards to their collections and iterators. C++ uses really stupid names, like ++ and *, rather than a simple, understandable next() and element() (or something along those lines), but that's just a naming convention. Java combines access and incrementation, which is very constraining, and not at all nice. But C++ takes the cake by requiring two iterators -- try using one function to determine the range that you want to pass to another function, and you'll pull your hair out. What I really don't understand in all this, of course, is that most pre-Java and pre-STL libraries used pretty good, straightforeward iterators -- like those described in the GoF Design Patterns book, for example, or those in the OSE C++ library. Given that we knew well how to do it before the STL or Java, it's hard to understand the design decisions in these libraries. (The Java Collections, in fact, implement the iterators in the USL C++ library almost exactly. Something that C++ users knew was a mistake as early as 1990.) Still, if you are going to learn C++, you probably have to count on investing a bit of time learning the STL. And THAT isn't easy. There are alternatives, like the OSE library, but they aren't widely used, and as a beginning C++ programmer, you probably won't be able to impose them on your employer. (I have yet to succeed in imposing them, and I'm far from a beginner when it comes to C++.) >> It's been ages (something like fifteen years) since I've used a null >> terminated character string in C++ other than at a C interface. In >> fact, if someone starts talking about null terminated character strings >> in C++, I pretty much take it as a sign that he doesn't know C++. > As you don't offer up your alternative, I'll just take that as a > personal slur. Sorry. Today, of course, std::string is pretty much standard. I don't know of a compiler which doesn't support it, and I don't know of any new code which doesn't use it. Before around 2000, of course, this wasn't so true. But I've still never seen a C++ application which didn't use some sort of String class. Historically, it was the first class you wrote; even today, a simple String class is a good exercise for a value oriented class. Think of it from a Java point of view. If the language didn't provide java.lang.String, would you really use Char[] with a '\0' terminator? Or would you write your own String class? >> > Fourth: Learn the containers in STL as soon as practically possible, >> > especially <map> and <list>. >> Regretfully, I'll agree. IMHO, the library is a disaster in C++, but it >> is very *in* to vault the STL. > The OP mentioned jobs that ask for C++ experience. Often that means that > they have an existing code base, and often the programmer who proceeded > you used STL. That depends. Real support for STL has only appeared in the last few years, so if the code base goes back some, they more likely have some third party library, or their own. And if they have their own, you'll find real resistance to the STL, even if their own is worse (and believe me, I've seen lots worse that the STL). On the other hand, one of the major motivations today for taking on new C++ programmers is to acquire knowledge of these new techniques. Personally, at the application level, I"ve yet to find the slightest use for template meta-programming (although it's fun -- very intellectually challanging), and I find the STL a disaster. But... good knowledge of the two will almost certainly land you a job. >> In practice, I'd say that you do have to >> know the tradeoffs with regards to the containers (vector, deque and map >> are the ones I use most often -- almost never list). On the other hand, >> I've found very little use for most of the algorithms in practical code. > I like the associative containers for parsing lvalue,rvalue pairs into. Agreed. Although as usual, the interface is a bit twisted. This is one point where Java is definitly better, although when I did Java daily, I missed the lack of type safety. >> > Good luck with that ;). Probably *the* best book (IMNSHO) for starting >> > out with C++ is Dietel & Deitel C++ How to Program. It's as dense as a >> > chocolate pudding, but it has all the bits. >> Once the basic syntax is mastered, I'd strongly recommend Scott Meyers' >> three books. The first one ("Effective C++"), particularly, addresses a >> number of classical issues that you just have to know. > Yep, second the Meyer's book. It's the Meyers' books. "Effective C++" and "More Effective C++" for the language, and "Effective STL" for the library. -- James Kanze home: www.gabi-soft.fr Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 9 pl. Pierre Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34 ============================================================================== TOPIC: NoSuchMethodException when reflecting ServletContext as a parameter http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a447e67bb400d60c ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:04 pm From: natG Hi; I am not new to reflection, but due to events, I feel new:). When passing a ServletContext as a parameter to the reflected method, it throws the NoSuchMethodException. Here is the exact simplified code that produces it. (Please excuse the extra Invoker class, I use it to test non-servlet related reflection.) [code] package ez.test; import javax.servlet.ServletContext; public class StaticMethodClass { public static void methodA(String s1, String s2){ System.out.println("Hello from methodA: s1 s2. You passed "+ s1 + " " + s2); } public static void methodA(ServletContext ctx, String s2){ System.out.print("Hello from methodA: ctx s2 . You passed "+ s2); System.out.println(" from ServletContext: " + ctx.toString()); } } package ez.test; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Invoker { Method m = null; public Invoker(String methodName, Object[] methodParameters){ runCustomMethod(methodName,methodParameters); } public void runCustomMethod(String methodName, Object[] methodParams){ Class c = StaticMethodClass.class; Method m = null; Class[] parameterTypes = null; if (methodParams!=null){ parameterTypes = new Class[methodParams.length]; for (int i=0;i<methodParams.length;i++){ parameterTypes[i] = methodParams[i].getClass(); } } try { m = c.getDeclaredMethod(methodName,parameterTypes); m.invoke(null,methodParams); } catch (SecurityException e) { System.out.println("Problem with *Security* in " +methodName +"."); //e.printStackTrace(); } catch (NoSuchMethodException e) { System.out.println("Error with the reflective method."+methodName + "."); //e.printStackTrace(); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (IllegalAccessException e1) { e1.printStackTrace(); } catch (InvocationTargetException e1) { e1.printStackTrace(); } } public static void main(String[] args) { new Invoker("methodA", new Object[]{"String-0","String-1"}); } } //now the real guy, the servlet. /* Date: 08/12/2004 14:08:57 */ package test; import ez.test.Invoker; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Nat * @version 0.01 * 08/12/2004 14:08:57 */ public class InvokeMethodServlet extends HttpServlet { ServletContext ctx = null; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String s0 = "StringFromServlet-0", s1= "StringFromServlet-1"; response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); out.println("<HTML>"); out.println(" <HEAD><TITLE>Test Reflection Servlet.</TITLE></HEAD>"); out.println(" <BODY>"); out.println("<p>This servlet simply tests reflection calls.</p>"); out.println("Check server log for output from strings: " + s0 + " " + s1); out.println("Also Check server log for output from CTX & string: " + s1); out.println(" </BODY>"); out.println("</HTML>"); out.flush(); out.close(); new Invoker("methodA", new Object[]{s0,s1}); //this works ok. new Invoker("methodA", new Object[]{ctx,s1}); //this does NOT. } public void init() throws ServletException { ctx=getServletContext(); } } [/code] Thank you, in advance. -nat ============================================================================== TOPIC: JavaMail sending email with no body content http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cec1a6c35fb18e1 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:05 pm From: "Steve D. Perkins" Hey everybody - I'm wondering if anyone's ever seen this issue before. I'm sending plain SMTP emails in a JSP (on WebSphere 4) using JavaMail 1.3.2, and the messages are being received with no body. Below is the basic gist of the block of code sending the emails. I know some things may look funny (specifying the SMTP server address in Transport.connect() rather than in the Properties object passed to the Session constructor, etc)... but I had some weird issues getting the app to resolve to the right mailserver box, and this is the version of code we came up with that actually results in emails being sent: Session mailSession = Session.getDefaultInstance(new Properties();, null); MimeMessage mimeMessage = new MimeMessage(mailSession); mimeMessage.setFrom(new InternetAddress("[EMAIL PROTECTED]")); InternetAddress[] address = InternetAddress.parse("[EMAIL PROTECTED]", false); mimeMessage.setRecipients(Message.RecipientType.TO, address); mimeMessage.setSubject("Test @ " + new Date().getTime()); MimeBodyPart mimeBodyPart = new MimeBodyPart(); mimeBodyPart.setText("This is a\ntest\n"); Multipart multiPart = new MimeMultipart(); multiPart.addBodyPart(mimeBodyPart); mimeMessage.setContent(multiPart); mimeMessage.setSentDate(new Date()); Transport transport = mailSession.getTransport("smtp"); transport.connect("mail.myserver.com", null, null); transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients()); I know that the version of JavaMail shipping with WebSphere 4 is older than 1.3.2, and this newer JAR may be unsupported and causing compatibility issues. To be safe, we'll be reverting back to the out-of- box configuration when the environment is rebuilt this evening. However, my gut still tells me there has to be something else in play. Has anyone else seen this issue before, and/or have any thoughts on what the solution may be? Thanks in advance! ============================================================================== TOPIC: HttpServletResponse http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f313cc803055284 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 12:20 pm From: Steve Sobol [EMAIL PROTECTED] wrote: > I am trying to do a > response.sendRedirect("http://"+"/servlet/MyServlet"); > > I get an error: > java.io.IOException: Response has been closed Well, that is probably because you're trying to redirect to the URL http:///servlet/MyServlet That doesn't work. If /servlet/MyServlet is served at the same hostname as the page you're redirecting from, for example if you're redirecting from http://abc.def.org/some.jsp to http://abc.def.org/servlet/MyServlet, then you can do this: response.sendRedirect("/servlet/MyServlet") otherwise you need to include the full URL. -- JustThe.net Internet & New Media Services, http://JustThe.net/ Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED] PGP Key available from your friendly local key server (0xE3AE35ED) Apple Valley, California Nothing scares me anymore. I have three kids. ============================================================================== TOPIC: Anyone have any experience with WebLogic 8? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c2807943e7284e7d ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:38 pm From: Juha Laiho "Tim" <[EMAIL PROTECTED]> said: >Thou shalt edit the config.xml or go to http://srvr:port/console and >login with system and password. Its called config.xml here but web.xml >I think is the general name used in Tomcat and others. config.xml and web.xml are different beasts; config.xml parametrizes the application server, while web.xml describes one deployed web application. The closest equivalent for config.xml in Tomcat is server.xml (but the elements and syntax is different); web.xml is web.xml with any web application container, as it is specified by the Sun Servlet Specification. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) ============================================================================== TOPIC: Unable to establish a socket connection - Got it! http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 12:42 pm From: [EMAIL PROTECTED] Steve Horsley wrote: > > So you need to fire up a webserver to server your applet. > > If you insist on running the applet like a local app, why not write > a local app, and forget this applet and security manager stuff altogether? > Because I am eventually planning on deploying an actual java applet to the web where the general public will be able to view the status of their case they have on file with the agency I work for. It appears that I should have focused on setting up a web server first before trying to learn the applet development side but it appeared, at first anyway, that I would be able to learn all of the java side before I tried to conquer setting up a web-server. The only problem was I wanted to get other members of our staff to test the applet from their PCs and make any suggestions they had. That's when I started getting the security exceptions, which led me to post this topic to this news group, etc. . . . It now appears that I should have started off with setting the web server up first before trying to build the applet. I know this has been a real pain in the a%*& to you guys but it has been extremely helpful to me. Now, I know what I need to do to go forward with this project. I fully expect to be running into roadblocks like this from time to time before I can call myself a web site developer but I believe it will be well worth it in the end. I want to thank both of you for the time and effort you have both put in one this. It has been helpful. Steve R. ============================================================================== TOPIC: What is "not" instanceof http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fd588d2bb2c2804 ============================================================================== == 1 of 3 == Date: Thurs, Dec 9 2004 9:49 am From: "HS1" Hello Could you please tell me what is "not" instanceof For example A is not instanceof B Thank you SH1 == 2 of 3 == Date: Wed, Dec 8 2004 8:51 pm From: "Steve D. Perkins" if(!(A instanceof B)) { .... } == 3 of 3 == Date: Wed, Dec 8 2004 8:51 pm From: natG HS1 wrote: > Hello > > Could you please tell me what is "not" instanceof > > For example A is not instanceof B > if !(A instanceof B) -nat ============================================================================== TOPIC: Java speed vs. C++. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 9:56 pm From: James Kanze [EMAIL PROTECTED] wrote: > first explain how your super contrived hello world example has any > RELEVANCE what so ever to Apache, Jakarta or anything thing else server > related? Actually, if he is counting on using Java to implement CGI scripts, he's found one of the few application areas where it is relevant. (Of course, one could question the reasonableness of such a choice, given the presence of JSP.) > If you are not a troll, then your least worry is the speed of running a > contrived hello world example, it is more like getting much more basic > fundemental understanding about practical programming. > if you are just trolling just stop. There are applications where start-up time is important. I have a couple of small programs that I invoke from the editor to filter part of the text -- typically just a couple of lines; JDK's start up time pretty much makes Java a no runner here. There are other applications where it isn't, but other things in Java implementations make the language inappropriate. And of course, there are other applications for which it is really the only reasonable alternative -- I'm certainly not going to write CGI code in *any* language if I can use JSP. For most large scale applications, of course, the performance of the language simply isn't an issue these days. -- James Kanze home: www.gabi-soft.fr Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 9 pl. Pierre Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34 ============================================================================== TOPIC: Thoughtsworks Job Interview? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 1:07 pm From: [EMAIL PROTECTED] (".") On Mon, 6 Dec 2004, Gary Labowitz wrote: > "Eric Sosman" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Virgil Green wrote: > > > "Anzime" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > > > The "coding tests" question intrigues me. Since I haven't interviewed > for a > > > job in over 15 years, I'm curious to know what kind of coding test > typically > > > would be used for a Java position. Are the interviewers interested in > your > > > ability to write good code in a timely fashion using the tools of your > > > choice (or similar), or are they interested in whether you've memorized > > > every class and every method signature in the standard libraries and can > > > crank out code in Notepad? > > > > > > What kinds of experiences have readers encountered? > > We used coding tests ("Programmer Aptitude Test") at IBM many years ago. It > was actually pretty simple and tested logical thinking. However, it ran into > legal problems. A test used to select or reject candidates must be shown to > be predictive of the work to be done; i.e. does the outcome of the test > actually reflect the ability of the candidate to do the actual work? Unless > there is some formal proof, the test can be deemed predujicial and > restrictive. The burden of proof falls on the employer to show that those > persons who do well on the test actually do well at the job. > I have found that chatting with a candidate, his hobbies, and previous > experience was more useful in evaluating several things, only one of which > was how he would do with the work. Work assignments can be tailored, > monitored, mentored, and trained for. More interesting is what personality > traits I could detect -- would this person "fit in," be interested in > solving puzzles, have the temperment to put up with frustration? Granted, it > is hard to evaluate with one sitting; thus, we had several persons do > interviews, and have call-backs to explore deeper. I still think a person > who can solve puzzles and enjoy them can become a good programmer. My experience has been questions that are more theoretical in nature. Typically I was given a test and then later I would have to justify my answers. Most the companies that didn't probe me much or were thrown when I actually had a lot of questions about how they do their job got written off. The company I now work at seems to use your methodology. I had a number of interviews with a number of different people. > Anyway, most job positions are so nebulously defined that many levels of > skill and experience can fit into them if need be. I always laugh at the > "requirements" the HR department puts on openings. Their job is to eliminate > candidates from the mix, but they cover the ground so thoroughly that there > is never anyone who could fit their requirements. They seem to think an > entry level programmer should know C++, Java, Enterprise Editions, XML, UML, > SQL Server, Oracle, SAP, and sometimes COBOL and assembly language. Go > figure. > Here's an example I just pulled from Monster: Requirements for a Java > programmer: > - 2 years experience working with Documentum products (version 5 preferred). > - Knowledge of Documentum APIs, DFCs, DQL, WDK, Application Builder/ > Developer Studio, Workflows, and Lifecycles. > - Programming experience in Java, JSP, XML, XSL and COM. > - Web development skills with knowledge of databases. > And this one almost looks possible! Am I wrong? While looking for a new job I talked a lot with others. Someone also brought up the fact that job descriptions were too restrictive. Someone noted that if a company wanted to hire a foreign employee they would take the employees resume, create a job description that matched the resume PERFECTLY then wait for all the residents of that country to fail. After a period of time the company could then claim they tried to hire someone locally but no one was qualified. Recently, I told a friend working in Dallas, TX I was quitting our company because the environment at my site (different country) was not good. He offered to get me transferred to Dallas. I told him there were plenty of people in Dallas who could do my job; there was no way I could get a work visa. He told me there were ways around that. Seems like it happens all the time. > -- > Gary > > > -- Send e-mail to: darrell dot grainger at utoronto dot ca ============================================================================== TOPIC: ServletExec hangman.jsp example problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54268d21ea6231b2 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 1:22 pm From: [EMAIL PROTECTED] 500 -matthew ============================================================================== TOPIC: Tool or IDE for function inlining http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/58fb84c0ecba12f0 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 1:38 pm From: "Alex" Dear All! I need to inline my functions bodys into caller functions. Please suggest me a good tool or IDE for refactoring. Currently I use Jbuilder 2005, but unsatisfied with its dumb text substitution and hungs. == 2 of 2 == Date: Wed, Dec 8 2004 1:54 pm From: Mark Thornton Alex wrote: > Dear All! > > I need to inline my functions bodys into caller functions. Please > suggest me a good tool or IDE for refactoring. Why do you need to do this? Most JIT compilers will do this automatically at run time where appropriate. Mark Thornton ============================================================================== TOPIC: URLencoder http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/74953a1a8483b844 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 2:15 pm From: "stud" I'm trying to compile next code I get this error: cannot resolve sysmbol class UnsupportedEncodingException what should I do? import java.sql.*; import java.rmi.*; import java.net.URLEncoder; public class SessionIDUtility { public static String generateSessionID() throws UnsupportedEncodingException { String uid = new java.rmi.server.UID().toString(); return java.net.URLEncoder.encode(uid, "UTF-8"); } public static void writeSessionValue(Connection con, String SessionID, String name, String value) { // write record to database for the provided sessionID ....................... ============================================================================== TOPIC: get and set Attribute for EJB Context (Storing objects) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ac27c0ee059670c ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 2:26 pm From: Collin VanDyck [EMAIL PROTECTED] wrote: > Are there any methods like getAttribute and setAttribute off the EJB > Context object like there is for Servlet context? > > Currently I did not see any in the API. How then are we supposed to > store objects that we want to exist for the life of the app server and > to be accesible by our beans? > > Thanks for any suggestions. > Could you use JNDI to store and lookup the objects like you would a DataSource? ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.java.programmer To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
