comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * newbie - jdbc Problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b61df05d633ffba * A Java "interface" declaration does not allow a constructor to be specified in it ... - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a241d06ab76f90b8 * getting the disk absolute path of a web-app - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cbdd00f8c8b7f37a * Tomcat responce time 10-200 seconds once in a while - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eff0206fed26be06 * Why the method of concat(String str) in String Class doesn't work? - 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f3694bc9d4d3d6 * Why the method of concat() doesn't work? - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c60d55d4b4874f1 * stubbing methods on test objexct with jMock - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8c79c894a412218 * Automatically adding missing cast - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f297258156171eae * Stupid Americans! -- Stupid... Stupid... STUPID!!! ___________ equksi - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9cbd15c38abae93 * Need help assigning instance of java class to a jobject - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ce91c30f1b4f226 * How do you read in an environment variable in an XML file? . . . - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cb8aa4e6df67759d * How can I change the location of the Web Start cache? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4aabb51e96392879 * request.setAttribute(...) versus session.setAttribute(...) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e301f649474cd744 * JTextpane Text Color - 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34429cbc78971fb3 * What is a Package in Java? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3e73247896cdb4d4 ========================================================================== TOPIC: newbie - jdbc Problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b61df05d633ffba ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 2:10 am From: "Andy Flowers" <[EMAIL PROTECTED]> As identified in another post, the statement query02 = "UPDATE HoursLog SET hours ="+ data+ "WHERE programmer='Pete'"; will fail as it will produce incorrect SQL. Also even if this is fixed in your code the hours will ALWAYS be 0 as the SQL string will be generated before you have read and set up data. A simple, and better, way to get around this is to use a PreparedStatement such as // initialise a prepared statement PreparedStatement ps = con.prepareStatement("UPDATE HoursLog SET hours=? WHERE programmer=?"); // read data (and possibly the programmer to update) .... // and then set the values you have read into the prepared statement ps.setInt(1, data); // hours to set ps.setString(2, "pete"); // programmer to update // and finally execute the update ps.executeUpdate(); Using a prepared statement will allow you to create the statement in some initialisation block, such as where you create the connection, and then have it reused by setting the parameters as needed. See the API documentation for more info at http://java.sun.com/j2se/1.5.0/docs/api/java/sql/PreparedStatement.html and also http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html "Xarky" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Following all your help, I did as follows: > > public void Transactions() > { > ResultSet result = null; > String query01 = null; > String query02 = null; > boolean flag; > int data=0; > > query01 = "SELECT hours FROM HoursLog WHERE programmer='Pete'"; > query02 = "UPDATE HoursLog SET hours ="+ data+ "WHERE programmer= > 'Pete'"; > System.out.println ("Trying to make a transaction on HoursLog > table."); > try > { > System.out.println ("Step 1"); > con.setAutoCommit(true); > result = stmt.executeQuery (query01); > System.out.println ("Step 2"); > flag = result.next(); > if (flag) > { > data = result.getInt("hours"); > data = data + 2; > System.out.println ("Step 3"); > stmt.executeUpdate (query02); > System.out.println ("Step 4"); > } // end if > else > { > System.out.println ("Data searched not found."); > } // end else > con.setAutoCommit(false); > System.out.println ("Transaction on HoursLog table completed."); > } // end try statment > catch(SQLException e) > { > System.err.println ("DatabaseMangager.Transactions() - Encountered > SQLException while trying to make a transaction on HoursLog table."); > System.err.println (e); > e.printStackTrace(); > System.exit(16); > } // end catch statment > } // end method Transactions > > Now I, my problem is between Step 3 and Step 4. Here I am executing > an Update Query. My problem should be that I am not assigning the > variable data to the query correctly. > > Can you please give me further help. > > > Thanks in Advance > > >> Try this: >> result = stmt.executeQuery ("SELECT hours FROM HoursLog WHERE >> programmer='Pete';"); >> boolean foundSomething = result.next(); >> if(!foundSomething) { >> // do somethig about this error >> } >> data = result.getInt("hours"); >> >> The result set is originally pointing at a place BEFORE the first line of >> the results. >> >> Steve ========================================================================== TOPIC: A Java "interface" declaration does not allow a constructor to be specified in it ... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a241d06ab76f90b8 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 2:26 am From: "Chris Uppal" <[EMAIL PROTECTED]> Casey Hawthorne wrote: > A Java "interface" declaration does not allow a constructor to be > specified in it -- has this been fixed in Java 1.5? An interface defines one aspect of the API to an /object/, part of that object's behaviour. Creating itself is not part of the object's behaviour so it doesn't belong in the interface. Now what you might want to do is find /another/ object who's job it is to create instances of the first class (or interface). /That/ object's role can be specified by an interface with no problem. Such objects-that-create-other-objects are normally called "factories". Factories don't have to be interfaces (most often they aren't), but they can be specified by them. E.g: E.g. ========== public interface Actor { void performSomeAct(); void performSomeOtherAct(); } public interface ActorFactory { Actor makeActor(); } ========== And then you might have concrete implementations. Here's a slightly complicated example with three kinds of factory object that share the same factory interface (the complexity is necessary to illustrate /why/ you might want to use factory interfaces in the first place). Note that nearly everything is package-private: ========== //////// The public bit //////// public class OverallSystem { public ActorFactory getDummyFactory() { return new DummyFactory() }; public ActorFactory getDeploymentFactory() { return new RealFactory() }; public ActorFactory getDebugFactory() { return new DebugFactory(getDummyFactory()) }; } //////// Some private factory classes //////// class DummyFactory implements ActorFactory { Actor makeActor() { return new DummyActor(); } } class RealFactory implements ActorFactory { Actor makeActor() { return new ComplicatedRealActor(); } } class DebugFactory implements ActorFactory { private final ActorFactory m_subFactory; DebugFactory(ActorFactory factory) { m_subFactory = factory; } Actor makeActor() { return new LoggingWrapper(m_subFactory.makeActor()); } } //////// Some private Actor classes //////// DummyActor implements Actor { void performSomeAct() { /* ignore it */ } void performSomeOtherAct() { /* ignore it */ } } ComplicatedRealActor implements Actor { void performSomeAct() { /* ...complicated code... */ } void performSomeOtherAct() { /* ...complicated code... */ } } LoggingWrapper implements Actor { private final Actor m_actor; LoggingWrapper(Actor actor) { m_actor = actor; } void performSomeAct() { log("someAct"); m_actor.performSomeAct(); } void performSomeOtherAct() { log("someOtherAct"); m_actor.performSomeOtherAct(); } } ========== -- chris ========================================================================== TOPIC: getting the disk absolute path of a web-app http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cbdd00f8c8b7f37a ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 12:39 am From: [EMAIL PROTECTED] (yair) Juha Laiho <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > [EMAIL PROTECTED] (yair) said: > >in a servlet running in tomcat, how can i get the full path of my web > >application on the disk (something like "c:\progran > >files\tomcat\webapps\myApp")? > >i don't want to write it in the web.xml or to pass it as a system > >property. > > Adding to the response by Will Hartung; for what would you need this; > what would you do with the information? Once we know that, we may be > able to propose alternative ways of solving the problem. thanks for u're answer first. i will have a folder named "tests" under webapps/myApp, and i want to read the names of the files in this folder. i m going to show the user a page with the names of those files and let him choose a file to run (this ofcourse is a very simplified version of what i m trying to do). this webapp will not be JAR-ed, so i dont have a problem with that. it seems like: javax.servlet.ServletContext.getRealPath("") or javax.servlet.ServletContext.getRealPath("/") r working fine, i think i'll use this way. thanks yair ========================================================================== TOPIC: Tomcat responce time 10-200 seconds once in a while http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eff0206fed26be06 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 4:24 am From: Christian Kalkhoff <[EMAIL PROTECTED]> Hi Roman, have you ever checked if there is some maintainance script running in mysql once a day? I dont know suse very well but some other linux distributions bring such "Database optimization"-Cron-Jobs out of the box. If your site is slow next time connect to the mysql database using the commandlinetool mysql or some gui and run query "show processlist". Look if there is something like "OPTIMIZE" in the list. Christian ========================================================================== TOPIC: Why the method of concat(String str) in String Class doesn't work? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f3694bc9d4d3d6 ========================================================================== == 1 of 4 == Date: Sun, Nov 7 2004 4:55 am From: "Bruce Sam" <[EMAIL PROTECTED]> Below is my simple java program: /* **************************************** */ public class MyString { public static void main(String[] args) { String str1 = "BCDE"; System.out.println(str1); String str2 = "A"; System.out.println(str2); str2.concat(str1); System.out.println(str2); } } /* **************************************** */ I think the run result should be as: BCDE A ABCDE But in fact,it is: BCDE A A Why the method of concat() doesn't work?What I hope to do is only to concatenate the str1 to the end of str2; == 2 of 4 == Date: Sun, Nov 7 2004 4:57 am From: Joona I Palaste <[EMAIL PROTECTED]> Bruce Sam <[EMAIL PROTECTED]> scribbled the following: > Below is my simple java program: > /* **************************************** */ > public class MyString { > public static void main(String[] args) { > String str1 = "BCDE"; > System.out.println(str1); > String str2 = "A"; > System.out.println(str2); > str2.concat(str1); > System.out.println(str2); > } > } > /* **************************************** */ > I think the run result should be as: > BCDE > A > ABCDE > But in fact,it is: > BCDE > A > A > Why the method of concat() doesn't work?What I hope to do is only to > concatenate the str1 to the end of str2; I haven't read the JavaDocs, but I think String.concat(String) does not alter the String which it was called on, but instead returns a new String. Try this: public class MyString { public static void main(String[] args) { String str1 = "BCDE"; System.out.println(str1); String str2 = "A"; System.out.println(str2); str2 = str2.concat(str1); System.out.println(str2); } } -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-------------------------------------------------------- rules! --------/ "How come even in my fantasies everyone is a jerk?" - Daria Morgendorfer == 3 of 4 == Date: Sun, Nov 7 2004 5:04 am From: "andreas kinell" <[EMAIL PROTECTED]> > Below is my simple java program: > /* **************************************** */ > public class MyString { > public static void main(String[] args) { > String str1 = "BCDE"; > System.out.println(str1); > String str2 = "A"; > System.out.println(str2); > str2.concat(str1); > System.out.println(str2); > } > } > /* **************************************** */ > I think the run result should be as: > BCDE > A > ABCDE > But in fact,it is: > BCDE > A > A > Why the method of concat() doesn't work?What I hope to do is only to > concatenate the str1 to the end of str2; > concat returns the new String. andreas == 4 of 4 == Date: Sun, Nov 7 2004 5:59 am From: "Paul H. van Rossem" <[EMAIL PROTECTED]> On 07-11-2004 13:55, Bruce Sam wrote: > Below is my simple java program: > /* **************************************** */ > public class MyString { > public static void main(String[] args) { > String str1 = "BCDE"; > System.out.println(str1); > String str2 = "A"; > System.out.println(str2); > str2.concat(str1); > System.out.println(str2); > } > } > /* **************************************** */ > I think the run result should be as: > BCDE > A > ABCDE > But in fact,it is: > BCDE > A > A > Why the method of concat() doesn't work?What I hope to do is only to > concatenate the str1 to the end of str2; > It can't alter str2, as String is immutable. So it returns a new String. Paul. ========================================================================== TOPIC: Why the method of concat() doesn't work? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c60d55d4b4874f1 ========================================================================== == 1 of 3 == Date: Sun, Nov 7 2004 4:58 am From: "Bruce Sam" <[EMAIL PROTECTED]> Below is my simple java program: /* **************************************** */ public class MyString { public static void main(String[] args) { String str1 = "BCDE"; System.out.println(str1); String str2 = "A"; System.out.println(str2); str2.concat(str1); System.out.println(str2); } } /* **************************************** */ I think the run result should be as: BCDE A ABCDE But in fact,it is: BCDE A A Why the method of concat() doesn't work?What I hope to do is only to concatenate the str1 to the end of str2; == 2 of 3 == Date: Sun, Nov 7 2004 5:05 am From: Lothar Kimmeringer <[EMAIL PROTECTED]> On 7 Nov 2004 04:58:28 -0800, Bruce Sam wrote: > Why the method of concat() doesn't work?What I hope to do is only to > concatenate the str1 to the end of str2; A String is immutable, so all methods that should do something with the content of a String can only return a new String containing the result. You just throw away that result in your source-code. You need to assign that result to a variable. Regards, Lothar -- Lothar Kimmeringer E-Mail: [EMAIL PROTECTED] PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81) Always remember: The answer is forty-two, there can only be wrong questions! == 3 of 3 == Date: Sun, Nov 7 2004 5:14 am From: Andrew Thompson <[EMAIL PROTECTED]> On 7 Nov 2004 04:58:28 -0800, Bruce Sam wrote: > Below is my simple java program: Good (simple) example, but please use indentation in future to make it easier to read. 2-3 spaces for each tab character (don't post tab characters) should be sufficient. In any case, you seem to have a misunderstanding about the method 'concat' actually changing a string, hopefully this will explain that it does not. <sscce> public class MyString { public static void main(String[] args) { String str1 = "BCDE"; System.out.println(str1); String str2 = "A"; System.out.println(str2); str2.concat(str1); System.out.println(str2); // 'concat' returns a string, it does not change the string System.out.println(str2.concat(str1)); // however you can assign the string returned to an attribute str2 = str2.concat(str1); System.out.println(str2); } } </sscce> BTW - in future, please post these sorts of (basic) question to a more appropriate group, described here. <http://www.physci.org/codes/javafaq.jsp#cljh> HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: stubbing methods on test objexct with jMock http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8c79c894a412218 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 5:02 am From: [EMAIL PROTECTED] (PeterS) Hi together, I am using jMock for doing my unit tests and it works fine. But there is one point I do not know how to solve it. I want to test a method ( e.g. "testMethod")in my object which calls another method (e.g. "anotherMethod") of the same object. I do not want to execute anotherMethod it´s own code. Instead it shall return a value controlled by the test case class. Can someone tell me what I have to do to achieve this aim with jMock? Many thanks With best regards Peter ========================================================================== TOPIC: Automatically adding missing cast http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f297258156171eae ========================================================================== == 1 of 2 == Date: Sun, Nov 7 2004 7:19 am From: Kai Grossjohann <[EMAIL PROTECTED]> Consider the following code snippet: for (Iterator it = coll.iterator(); it.hasNext();) { String elem = it.next(); } It produces the following compilation error (Sun JDK 1.4.2): foo.java:47: incompatible types found : java.lang.Object required: java.lang.String String elem = it.next(); ^ I'm interested in writing code to fix this error automatically. It is very easy to see what needs to be done: add a cast to String before the "it.next()" expression. Programmatically, it is also easy to find out which class to use for the cast -- it is mentioned in the "required" line. But the problem is to find the right spot to add the cast. Clearly, the spot indicated by "^" is not the right spot. Does anyone have suggestions for this? Kai == 2 of 2 == Date: Sun, Nov 7 2004 7:06 am From: karlheinz klingbeil <[EMAIL PROTECTED]> Kai Grossjohann schrub am Sonntag, 7. November 2004 16:19 folgendes: > But the problem is to find the right spot to add the > cast. Clearly, > the spot indicated by "^" is not the right spot. > Does anyone have suggestions for this? > use Java 1.5 (or 5.0 as its called by Sun). 1.5 has generics, what does exactly what you want. -- greetz Karlheinz Klingbeil (lunqual) http://www.lunqual.de oder http:www.lunqual.net ========================================================================== TOPIC: Stupid Americans! -- Stupid... Stupid... STUPID!!! ___________ equksi http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9cbd15c38abae93 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 4:04 am From: [EMAIL PROTECTED] You blithering idiots! You re-elected that imbecile George Bush as your President. Hes a complete moron and so are most of you! - Dont you care what the rest of the world thinks of you? Dont you care what impact American foreign policy has on the rest of the planet? Does Iraq look like a success to anyone? Doesnt it bother you that hes alienated every friend you have? What were you thinking??? - Prior to this, it was American policy and the American government that was so universally hated around the world. Now it's going to be 'Americans' we hate. More sympathy for Bin Laden... More attacks on American institutions... More isolation. How blind can you dumb rednecks in middle-America be, not to see this? - If you get hit again, or your economy goes into a deep depression, the American people will be getting exactly what they deserve! - <back turned> - - - - - - [Ignore what follows] What did Sayed sow the unit over the abysmal draper? She'd rather live wrongly than laugh with Moustapha's blank pear. Better mould diets now or Muhammad will globally pull them outside you. We receive the short envelope. When did Ann creep between all the clouds? We can't grasp pins unless Zakariya will wistfully walk afterwards. It can change wet smogs beneath the sharp dark light, whilst Founasse nearly cares them too. They are joining in front of the shore now, won't shout jackets later. She might tease truly, unless Susanne looks teachers about Satam's cap. She should mercilessly scold between Rahavan when the young yogis fill to the polite satellite. She can cook incredibly if Founasse's boat isn't cold. One more deep sauces at the long street were talking with the humble morning. Don't promise the papers weekly, solve them quickly. Let's learn against the active rooms, but don't irritate the younger bowls. The books, counters, and cars are all kind and filthy. Generally, lentils kill beneath full autumns, unless they're dull. Try liking the foothill's good floor and Eddie will answer you! We irrigate them, then we quietly recommend Nydia and Pauline's clean goldsmith. Just moving near a pen about the ladder is too dirty for Samuel to seek it. One more quiet cobblers are elder and other healthy pitchers are empty, but will Ramsi dine that? Every urban stale farmer cleans pickles beneath Toni's open enigma. For Hector the powder's solid, at me it's sad, whereas against you it's recollecting heavy. Brahimi believes the coffee in hers and admiringly kicks. Don't fear a desk! To be lost or lower will climb difficult poultices to wickedly nibble. I was pouring to cover you some of my rural aches. The tired pool rarely opens Aziz, it smells Karim instead. ========================================================================== TOPIC: Need help assigning instance of java class to a jobject http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ce91c30f1b4f226 ========================================================================== == 1 of 2 == Date: Sun, Nov 7 2004 7:26 am From: MP <[EMAIL PROTECTED]> I have the Invocation API code working properly. I get a jclass with the proper path to our jar successfully. I would now like to create an instance of this class so I can call some non static instance methods on it. I can successfully get its constructor (I think that's what I'm getting) by using mid = env->GetMethodID(cls, "<init>", "()V);. However, when I try to get create an instance jobject theclass = env->NewObject(cls, mid) I get a NULL returned. Any ideas? == 2 of 2 == Date: Sun, Nov 7 2004 8:39 am From: Oscar kind <[EMAIL PROTECTED]> MP <[EMAIL PROTECTED]> wrote: > I have the Invocation API code working properly. I get a jclass with the > proper path to our jar successfully. I would now like to create an > instance of this class so I can call some non static instance methods on > it. I can successfully get its constructor (I think that's what I'm > getting) by using mid = env->GetMethodID(cls, "<init>", "()V);. However, > when I try to get create an instance jobject theclass = > env->NewObject(cls, mid) I get a NULL returned. Any ideas? Yes: this is not Java. Hint: the "->" operator doesn't exist. That's C/C++. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: How do you read in an environment variable in an XML file? . . . http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cb8aa4e6df67759d ========================================================================== == 1 of 2 == Date: Sun, Nov 7 2004 7:58 am From: [EMAIL PROTECTED] (Albretch) that was set up for and/or by this user in the OS. Say, you set WEB_DIR as an environment variable pointing to certain folder or root directory Could you go like this <?xml version='1.0' encoding='utf-8'?> <XMLExample Att1="69" Att2=$WEB_DIR"rest_of_it"> . . . </XMLExample> for attributes or values? And when a program parses the XML doc it should pick the current env. var. value. I think of using it for tomcat's configuration files which are more XMLish than true XML ones. There are ways to pass in parameters to the JVM when you run a java prog., but I don't know of a way to read in an external environment variable from the OS into an updated conf doc and use this value How do you do something like that? == 2 of 2 == Date: Sun, Nov 7 2004 8:45 am From: Oscar kind <[EMAIL PROTECTED]> Albretch <[EMAIL PROTECTED]> wrote: > that was set up for and/or by this user in the OS. > > Say, you set WEB_DIR as an environment variable pointing to certain > folder or root directory > > Could you go like this > > <?xml version='1.0' encoding='utf-8'?> > <XMLExample Att1="69" Att2=$WEB_DIR"rest_of_it"> > > . . . > > </XMLExample> > > for attributes or values? [...] > How do you do something like that? Yourself. AFAIK, XML parsers don't expand environemtn variables. To get the value of an environment variable, see: - System#getProperty(String) - Integer#getInteger(String) - Long#getLong(String) - And similar methods in these classes. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: How can I change the location of the Web Start cache? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4aabb51e96392879 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 8:18 am From: Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> Hello Andrew, Andrew Thompson wrote: > On Fri, 05 Nov 2004 18:00:26 +0000, Tarlika Elisabeth Schmitz wrote: > >>The user shouldn't have to know anything about webstart. I just want >>them to click their application icon, which fires up the application and >>if need be downloads the latest jars. I don't want them to get prompted >>about desktop integration and certificates. > > > Can you make that first invocation 'invisible' by initiating > and controlling it from a script*? That way it might at least > get around the 'multi-step' process. Once "javaws http://myserver/myapp.jnlp" has been run once the app will simply fire up *without* prompting the user to accept certificates, nor will JWS prompt about desktop integration after the initial cache download. Even if newer jars have to be downloaded, JWS will not prompt the user to accept/reject certificates - I presume, however, this is only the case if these are signed with the same certificates as previously. Therefore all you need is a desktop icon which runs the command "javaws http://myserver/myapp.jnlp". This will work even if the user has deleted the JWS cache by hand. However, in this case the user would be prompted to accept the certificates. The desktop integration query can be suppressed via the WebStart preferences (choose "Never ask to integrate".) If you use the JWS created desktop icon instead, "javaws ${usrhome}\...\javaws\cache\indirect\indirect59840.ind" will be executed. Should the user ever delete his cache including the indirect file by hand, then this icon would no longer work as with the next download a new indXXXX.ind file with another random number would be generated. > Even better if you can run that script on every machine on the > intranet at some inconspicuous hour - like 4am. ;-) > * (Off the wall suggestion, I do not even know if this is possible) Possible but no need as it is only the first download that causes the prompts. >>*I'm not quite sure now, what's the point of the desktop integration? I >>can simply create a shortcut which executes "javaws XXX.jnlp". Or am I >>missing something? If you have the client machines under control executing creating an icon that executes "javaws http://myserver/myapp.jnlp" rather than desktop integration seems to be the safer option. > Yes, I had been approaching that conclusion myself. > > I'd still love for anybody to pop in and point us both to > the 'magic' bit we missed, though. We can't be the only WebStart "specialists" in this group ;-) -- Regards/Gruß, Tarlika ========================================================================== TOPIC: request.setAttribute(...) versus session.setAttribute(...) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e301f649474cd744 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 8:40 am From: "johnangxun" <[EMAIL PROTECTED]> to: john C. Bollinger&q; > As Sudsy was pointing out, you also need to watch out > for caching behavior. User agents (generally browsers), > proxies, and web servers all may cache responses under > certain circumstances. All may cause trouble, but the > most likely to do so are user agents. For instance, > when a human user clicks the *"Back"* button on his > browser's toolbar, he will generally get a cached > version of the previously visited page instead of > causing a new request to be issued for that page. This > may be different from what he would get by reissuing the > same request by which the cached page was originally > fetched. Can u explain more about this. I not clear to it. Thanks. Recently I deal with the form processing. I have one form, user will key in a lot of the field. After human user finish key in, the enter the submit, the *confirmation page* will display, which show all the data key in by user. If human user need to change the information, their can click *back* button to rekey in again. But if I click the back button, all the information is the submit form(first form) will lost. So is it any way to solve it. If I use the session.setAttribute at the submit form(first page) will it help? Thanks in advance! ========================================================================== TOPIC: JTextpane Text Color http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34429cbc78971fb3 ========================================================================== == 1 of 5 == Date: Sun, Nov 7 2004 8:48 am From: "Vincent Poile" <[EMAIL PROTECTED]> Hi, i want to change the color of specific words, in a JTextpane, without changing the rest of the text, is this possible if so how would i go about doing it, I will have an array of words which i want to match against and then the text in the JTextpane will be random and i would like to be able to do this automatically if possible Thanks for you help Vince == 2 of 5 == Date: Sun, Nov 7 2004 8:52 am From: Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> Vincent Poile wrote: > Hi, i want to change the color of specific words, in a JTextpane, without > <snip> This is really a question for c.l.j.gui -- Regards/Gruß, Tarlika Elisabeth Schmitz == 3 of 5 == Date: Sun, Nov 7 2004 8:56 am From: Andrew Thompson <[EMAIL PROTECTED]> On Sun, 07 Nov 2004 16:48:58 GMT, Vincent Poile wrote: > Hi, i want to change the color of specific words, in a JTextpane, without > changing the rest of the text, is this possible if so how would i go about > doing it, You might use a JEditorPane and wrap your content in HTML. -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane == 4 of 5 == Date: Sun, Nov 7 2004 9:00 am From: Andrew Thompson <[EMAIL PROTECTED]> On Sun, 07 Nov 2004 16:52:01 +0000, Tarlika Elisabeth Schmitz wrote: > Vincent Poile wrote: > >> Hi, i want to change the color of specific words, in a JTextpane, without >> <snip> > > This is really a question for c.l.j.gui Good point, you'll probably get better thought out answers than 'use a JEP' on c.l.j.g. For a quick summary of the major Java groups, check.. <http://www.physci.org/codes/javafaq.jsp#groups> -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane == 5 of 5 == Date: Sun, Nov 7 2004 9:19 am From: "Vincent Poile" <[EMAIL PROTECTED]> Ok thanks "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 07 Nov 2004 16:52:01 +0000, Tarlika Elisabeth Schmitz wrote: > >> Vincent Poile wrote: >> >>> Hi, i want to change the color of specific words, in a JTextpane, >>> without >>> <snip> >> >> This is really a question for c.l.j.gui > > Good point, you'll probably get better thought out > answers than 'use a JEP' on c.l.j.g. > > For a quick summary of the major Java groups, check.. > <http://www.physci.org/codes/javafaq.jsp#groups> > > -- > Andrew Thompson > http://www.PhySci.org/codes/ Web & IT Help > http://www.PhySci.org/ Open-source software suite > http://www.1point1C.org/ Science & Technology > http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: What is a Package in Java? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3e73247896cdb4d4 ========================================================================== == 1 of 1 == Date: Sun, Nov 7 2004 10:03 am From: Katerina MacLean <[EMAIL PROTECTED]> What is a package in java? My assumption is that it is a collectyion of classes that are compiled together and have dependency - is this correct? ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
