 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- Displaying multiple beans in a struts formI have a list of beans that I retrieved from a database. These beans
are all of the same class. Now I want to display these beans in a
struts form so that the user can modify the data in the beans and save
it back to the database.
Can anyone help with this problem? Is there any sample code out there
that would show how to do this?
Thanks
- 2
- JBOSS and IPlanet setupHi,
This is a generic architectural question. I am not sure if this can
be posted at this forum.
I am using JBOSS as App server and Iplanet as WebServer and Reverse
Proxy plugin to forward all the JSP requests from Iplanet to JBOSS.
Both Web Server and App server are on different boxes.
When I request a JSP page, its coming up fine. But if that JSP page
has a 'response.sendRedirect' in it, then its failing to redirect to
the specified page. Instead its going to the webserver root.
Also, this behaviour is not consistent - meaning, sometimes it goes
through and sometimes its coming back to webserver root.
Using 'response.forward' fixed the problem.
But I do not want to use 'forward' in the web application because of
the obvious diff between 'forward' and 'redirect'. (Using the forward
doesn't change the URL and upon browser refresh, the same form gets
submitted again and again)
Are there any alternatives to fix the redirect problem?
Any help is appreciated.
Thanks,
-Sudheer
- 4
- 6
- Reading file lines into large ListHi all,
I have tried posting this problem a few times looking for a solution.
What I have works but is slow.
I have to read unordered data from a text file. Data A has a
one-to-many relationship with Data B, and Data B has a one-to-many
relationship with Data C . Once I find Data A, Data B and Data C could
be anywhere in the file. So I do a RandonAccessFile.seek(0) . This
needs to be repeated hundereds of times for lots of Data B and Data C
relationships.
I'd like to put the file in memory. However, I'm using Scanner and
regex to get the data. I don't think I can run Scanner on ByteBuffer
per line.
So my latest idea is to read the file per line and store it in List. So
a 10,000 line file would have a 10,000 size List. That way I could run
Scanner on the Strings in the List, and Iterate repeatably. The data in
the List would be read only.
Any advice appreciated.
iksrazal
- 6
- Labels and paint questions...I have an applet, here
http://www.aquaticwhirlpools.com/sean/selectMenu.html
What I need is for the select menus to have some space between
them so that I can have the orange/yellow images next to each one.
As you can see, there is a bit of one of the images next to
"by product size" and a full image next to "by model".
The space between the two "by product size" and "by shape" is
created by an empty label. The image is placed in the paint method.
The problem is that without the empty label, the menus have no space
between them, as with "by shape" and "by model". Is there any other
way to create that space... or is there a way to make the images 'paint'
on top of the labels?
Thanks for any help.
- 8
- Finding BeanInfo for superclass?Hi,
I'm having a problem or a misunderstanding with BeanInfo.
I have a class Alpha, and a class Beta. Beta extends Alpha. I've
created an AlphaBeanInfo class.
The following code works fine:
BeanInfo info = Introspector.getBeanInfo(Alpha.class);
...
Problem is though when I call the following code:
BeanInfo info = Introspector.getBeanInfo(Beta.class);
...
AlphaBeanInfo is not returned, nor are any of its methods called
(verified via debugging)
Shouldn't this be returned by the Introspector? I could of course write
a BetaBeanInfo, but this seems silly to have to do this.
Any ideas/clarifications?
Many thanks,
M
- 8
- 8
- ADT's vs. interfaceswhat is the differences between ADT's and interfaces? also what are
abstract classes? can you also include examples?
thnks
- 14
- Tomcat and QueueHi,
Does any one know about the Coyote connector queue in Tomcat?
How does it work? if a connection gets queued then when does it get a
thread? will it be given preference over the requests arriving after
its arrival??
rgds,
Prashant
- 14
- What is J2EE and an application server?Can someone explain to me what java enterprise edition is?? I've been
looking into the web for some info, but can't really make sense of the
info found. Is there also an tutorial avaible?
I've found one at the java site, but there it was attached to an
application server. And that's my second question, what is a
application server and what can u do with it??
Thnx someone.....
- 15
- A little optimization question: Local var allocationI often wonder: Does it make any difference in EXECUTION TIME which
version I choose:
#1:
String st;
while (true){
st=dis.readLine();
if (st==null) break;
< do something else >
}
#2:
while (true){
String st=dis.readLine();
if (st==null) break;
< do something else >
}
It's obvious that st is valid outside the loop in #1. But does it get
allocated on the stack for every iteration in #2, or just re-used? If
not, I suppose #2 is preferred as far as limiting the scope, enabling
gc, is an issue.
Chris
- 16
- setCursor() for a ContentPanel
Joana,
I was having a similiar problem and did some searching and found the
following forum:
http://forum.java.sun.com/thread.jsp?forum=57&thread=110928
Basically, I think you need to use setCursor on the GlassPane. I used
the following code in my application and it seems to work.
Component gp = getGlassPane();
gp.setVisible(true);
gp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//do your computations
gp.setCursor(Cursor.getDefaultCursor());
gp.hide();
Hope this helps,
Kin Wong
On 14 Jun 2003 09:09:45 -0700, email***@***.com (Joana)
wrotE:
>Hi!
>
>May I ask you for a favour ... a hint would please me a lot ...
>
>When the Graph is completely shown in the window I can see no
> WAIT_CURSOR, but DEFAULT_CURSOR.
>When I move the mouse out of the window and hit back the window area I
>get the WAIT_CURSOR.
>
>Could You please tell me, where is my bug or better what should I do,
>to get the WAIT_CURSOR during the graph computing process
>
>Thanks a lot for every single answer!
>
>Best regards,
>Joana
- 16
- Fwd: Reminder: Call for FreeBSD status reports!FYI.
Ernst
---------- Doorgestuurd bericht ----------
Subject: Reminder: Call for FreeBSD status reports!
Date: maandag 29 september 2003 23:33
From: Scott Long <email***@***.com>
To: email***@***.com
All,
Don't forget to submit your FreeBSD status reports by Oct 1, 2003!
These reports are open to not only official project memebers, but also
to anyone who is engaged in the development of projects that relate to
FreeBSD. Kernel, userland, ports, documentation, installation,
integration, etc, reports are all welcome and encouraged. Reports should
be 1-2 paragraphs in length, focus on one topic, and should follow the
template that is available at
http://www.freebsd.org/news/status/report-sample.xml.
Submissions must be made to email***@***.com. Submissions for multiple
projects per person are welcome.
Thanks!
Scott Long
Robert Watson
-------------------------------------------------------
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 16
- "CallByName" in Java?Hello,
is there any way to do the job "CallByName" (as in VB) for Java? We want to
build a hashtable which has the
names of java methodes with their parameters, and later all the methodes
will be called only by
names automatically.
Thanks,
Le
- 16
- User privilege for getMetaData()When using a basic user with only data query and update privileges I
cannot get column data from the DatabaseMetaData object returned from
getMetaData() (on a connection using the JDBC Oracle thin driver).
When I use the schema owner with full privileges, I get the column
data. What privilege is necessary to get column information from
getMetaData?
|
| Author |
Message |
MichibeckD

|
Posted: 2003-9-17 16:28:00 |
Top |
java-programmer, jxta in subnet
Hallo,
i have a broblem with the jxta technology. I build up a testbed
consisting of a server a router and two clients. The router is
connected to the two clients and the server. Any connection from one
client to another or from one client to the server goes through the
router. Client 1 is configured with ip 192.168.100.1, client two with
172.16.0.1 and the server with 10.0.0.2. So the router routes for
three different subnets. No machine has access to the another (except
the router). There is also no connection to the internet.I wrote an
application built on jxta. The application runs on the server and the
two clients. I configured the peers as rendevouzs and added to every
peer the ip's of the two others to the list of known rendevouzs peers.
When i run my application, the peers can find each other, BUT it needs
a lot of time, somtimes about 10 miutes. I cannot understand this,
because the peers know each other by the list of known rendevouzs. How
can i improve the time the peers need to find each other? I think my
configuration settup is ok (, otherwise the peers never would find
each other?).
Can anyone help me ?
Michibeck.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Crystal Report Change Data SourceI have a few crystal reports (XI) that uses JDBC to connect to MS SQL
Server. The JDBC Driver is JTDS 1.1. Now I am trying to update the data
source definition to include JNDI name so it can be more portable. The
trouble is I can't update it.
Here's what I've tried on existing working reports:
- Go to "Set Datasource Location" dialog, expand current data source
properties, add JNDI connection name. Crystal now pops up a dialog box,
asking me to confirm connection info. So I put in user ID and Password.
Clicking "Finish" and Crystal pops up a message saying "Logon failed.
Details: SQL Exception: [SQL State:] 08501 [Error Message:] Network
error IOException: Connection refused: connect". Then the same
connection fonfirmation dialog come up again as if i typed in wrong
user name and password.
- The next thing I tried (since I can't manually add JNDI name) is to
replace existing datasource with another one. Again, I go to "Set
Datasource Location". I've already defined another JDBC connection with
JNDI name in it. now selecting existing connection in the tree at the
top and select the new connection in the tree at the bottom, click
"Update". Now connection confirmation dialog pops up. After entering
user id and password, I click Finish. Then Crystal says
- "Data Object cannot be opened/accessed."
- "Database Connector Error: 'Unexpected error'"
- "Data Object cannot be opened/accessed."
- "Database Connector Error: 'Unexpected error'"
- "Some tables could not be replaced, as no match was found in the
new data source. Please specify the table required for any unmodified
tables."
Some more information regarding existing reports. When I created the
reports, Crystal complains about not able to find the tables and offer
me to remove the related fields from the report. I clicked "No" and the
reports still runs perfectly fine.
There isn't much I can do after this. So I look up on the web, I think
it may have to do with the not so well implemented "verify database"
functionality, but I have no way to prove or solve it.
Can anyone help me on this? The database is the same, so theoretically
there shouldn't be any problem updating the datasource defintion,
especially when the datasource is the same as before. And adding JNDI
name to the report shouldn't be a problem either because it won't get
use until a Java app try to run it.
Any suggestions?
Thanks,
Jo
- 2
- How to accept the Untrusted cert?Dear All,
I use JSSE to implement a proxy server which support http/https.
However, I find my code can't support some secure site which provide a
certificate which doesn't signed by CA.
and here is the error message:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate
found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at Proxy.SSLNegotiation.startNegotiation(SSLNegotiation.java:101)
at Proxy.SSLProxyProcess.makeNegotiation(SSLProxyProcess.java:383)
at Proxy.SSLProxyProcess.run(SSLProxyProcess.java:83)
at Proxy.ProxyProcess.run(ProxyProcess.java:107)
Caused by: sun.security.validator.ValidatorException: No trusted
certificate found
at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:304)
at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:107)
at sun.security.validator.Validator.validate(Validator.java:202)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA12275)
... 10 more
java.net.SocketException: Socket is closed
at java.net.Socket.setSoTimeout(Socket.java:920)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setSoTimeout(DashoA12275)
at Proxy.HttpResp.<init>(HttpResp.java:53)
at Proxy.SSLProxyProcess.makeNegotiation(SSLProxyProcess.java:385)
at Proxy.SSLProxyProcess.run(SSLProxyProcess.java:83)
at Proxy.ProxyProcess.run(ProxyProcess.java:107)
what should i do to accept the self-sign certificate?
Thank,
Jake
Here is my code.
package Proxy;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyStore;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory;
public class SSLNegotiation {
private Socket socket = null;
private String host = null;
private int port;
private String keyStore = null;
private char keyStorePass[] = null;
private char keyPassword[] = null;
private String sslContextInst = null;
private String keyStoreInst = null;
private String keyManagerFactoryInst = null;
private String trustManagerFactoryInst = null;
public SSLNegotiation(Socket socket) {
this.socket = socket;
host = socket.getInetAddress().getHostName();
port = socket.getPort();
}
public SSLNegotiation(String host, int port) {
this.host = host;
this.port = port;
}
public SSLNegotiation(Socket socket, String host, int port) {
this.socket = socket;
this.host = host;
this.port = port;
}
public void importKeyStore(String ks, String ksp) {
importKeyStore(ks, ksp, ksp);
}
public void importKeyStore(String ks, String ksp, String kp) {
keyStore = ks;
keyStorePass = ksp.toCharArray();
keyPassword = kp.toCharArray();
}
public void setInstance(String content, String ks, String kmf, String
tmf) {
sslContextInst = content;
keyStoreInst = ks;
keyManagerFactoryInst = kmf;
trustManagerFactoryInst = tmf;
}
public Socket startNegotiation(boolean connectServer) {
KeyStore ks = null;
KeyManagerFactory kmf = null;
SSLContext sslContext = null;
SSLSocket sslSocket = null;
try {
ks = KeyStore.getInstance(keyStoreInst);
ks.load(this.getClass().getResourceAsStream(keyStore),
keyStorePass);
kmf = KeyManagerFactory.getInstance(keyManagerFactoryInst);
kmf.init(ks, keyPassword);
sslContext = SSLContext.getInstance(sslContextInst);
if (trustManagerFactoryInst == null)
sslContext.init(kmf.getKeyManagers(), null, null);
else {
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(trustManagerFactoryInst);
tmf.init(ks);
sslContext.init(kmf.getKeyManagers(),
tmf.getTrustManagers(),
new java.security.SecureRandom());
}
SSLSocketFactory factory = sslContext.getSocketFactory();
if (socket != null)
sslSocket = (SSLSocket) factory.createSocket(socket, host, port,
false);
else
sslSocket = (SSLSocket) factory.createSocket(host, port);
sslSocket.setUseClientMode(connectServer);
sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites());
if (connectServer)
sslSocket.startHandshake();
} catch (UnknownHostException uhe) {
uhe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
return sslSocket;
}
}
}
- 3
- exception in at javax.swing.SwingGraphics.createSwingGraphicsI am getting the following exception sometimes in my GUI. How can I
debug this? There is nothing from my code in the stack and the
exception is not easily reproducible. Any help will be greatly
appreciated.
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1064)
at
javax.swing.SwingGraphics.createSwingGraphics(SwingGraphics.java:147)
at javax.swing.JComponent._paintImmediately(JComponent.java:4670)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(JComponent.java:4671)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
In paintImmediately null graphics
- 4
- Hot opportunities for Java Consultants in ClevelandHey All -
I'm putting out an A.P.B. for Java Developers in the Cleveland area,
or folks who are willing to work in Cleveland. Sun Certification is a
huge plus, and consulting experience would make you a rock star.
Contact me via e-mail with a resume if you're interested, and feel
free to tell friends!
Thanks,
Jerome
- 5
- Mixed SAX and DOM processing: echoing with occassional changes.I need to write a tool which will allow me to process a huge document
with chunks of it in memory. The procedure is to echo XML coming from
some input to an output, then when I hit a certain type of element,
read all of its children into a DOM and somehow manipulate it
(specifically, the goal is to hand it to a rules engine which will add
flags). After that is complete, serialize it right back out to the
stream and resume processing.
My approach currently involves a ContentHandler object which simply
serializes every event using a TransformerHandler object. When I see
the element I want, I start creating Node objects in a stack and
assembling them into a DOM as I hit closing elements. The problem is
that there is no direct way of serializing that DOM to the same output
stream without violating encapsulation. At first I thought that I
would be able to pass the DOM to a SAX ContentHandler (which I would
provide with a reference to the TransformerHandler doing the
serialization). However, it turns out that isn't the case. I do not
want to reinvent the wheel and walk the DOM manually nor do I want to
create (potential) side-effects by writing directly to the OutputStream
wrapped by my Result object using XMLSerializer on the DOM. XMLFilters
do not appear to be a solution because I cannot apply my rules in a
streamable fashion (and getting a DOM from the incoming stream is not
the difficult part anyway).
I've looked around and found a variety of mixed parsing techniques, but
it seems that none of them quite meet my needs. Writing a class which
takes a DOM, walks it, then calls the appropriate ContentHandler
methods would not be too painful, but this seems horribly inelegant to
me. Also, I cannot even begin to fathom that I am the only person who
wants to do this.
Any suggestions?
(What follows is some code which may give an idea of where I am at.
Simplified for brevity.)
// Initial invocation
final SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
final SAXParser parser = factory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
final TransformerHandler handler = getTransformerHandler(System.out);
reader.setContentHandler(new EvaluationHandler(handler));
reader.parse("foo.xml");
// EvaluationHandler (derives from a class which echoes to a provided
ContentHandler)
public void startElement(final String uri, final String localName,
final String qName, final Attributes attributes) throws SAXException
{
if (performDOMProcessing())
{
final Element element = this.host.createElementNS(uri, qName);
addAttributes(element, attributes);
this.buffer.push(element);
}
else
{
super.startElement(uri, localName, qName, attributes);
}
}
public void endElement(final String uri, final String localName, final
String qName) throws SAXException
{
if (performDOMProcessing())
{
final Node element = this.buffer.pop();
if (this.buffer.isEmpty())
{
if (this.host.hasChildNodes())
{
final Element root = this.host.getDocumentElement();
this.host.removeChild(root);
}
this.host.appendChild(element);
// Do processing against this.host with rules engine.
// Pass off to serialization.
}
else
{
this.buffer.peek().appendChild(element);
}
}
else
{
super.endElement(uri, localName, qName);
}
}
public void characters(final char[] characters, final int start, final
int length) throws SAXException
{
if (performDOMProcessing())
{
final String text = new String(characters, start, length);
final Text textNode = this.host.createTextNode(text);
this.buffer.peek().appendChild(textNode);
}
else
{
super.characters(characters, start, length);
}
}
- 6
- Great Documentation for Investment and Trading SystemsJust wanted to let people know about a new, free Encyclopedia for Investors
and Traders who are building or maintaining systems:
Http://www.itsdoc.org
"itsdoc" stands for "It's Documentation."
The site attempts to provide highly accurate documentation in an
encyclopedia format. It's 100% free, with no
advertising whatsoever and no soliciting. The entity is entirely non-profit.
Users are invited to contribute high quality material to the site and also
draw
from the considerable knowledge base hosted there. If you are coding
investment
and trading systems you will probably find this site extremely helpful.
It's new, the official launch isn't until January so the site has a few
rough
edges right now. Still, its very useful.
I hope you get a lot out of it. Please help promote it and put something
back into it too.
Rick
- 7
- Struts Readonly...Hi,
can anybody tell me, if it's possible to set sturts fields in an jsp
site to readonly via an action?
Hope it is understandable what I want, my englisch isn't the best...
Greetings
Laverna
- 8
- ReportViewer.jarI need ReportViewer.jar file which is required to call Crystal Reports
within Java. All other required .jar files, I have got.
Please provide me this file at <email***@***.com>
imediatly, if you have. I will be very thankfull to you.
HERE IS CODE:-
*/
import java.awt.*;
import javax.swing.*;
import com.crystaldecisions.ReportViewer.*;
// Use these to talk to RAS
import com.crystaldecisions.sdk.occa.report.application.*;
import com.crystaldecisions.sdk.occa.report.reportsource.*;
public class HelloWorldSwing
{
private static void createAndShowGUI()
{
try
{
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(false);
//Create and set up the window.
JFrame frame = new JFrame("HelloWorldSwing");
frame.setTitle( "Testing 1, 2, 3");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ReportViewerBean viewer = new ReportViewerBean();
viewer.init( new String[0], null, null, null);
ReportClientDocument rpt = new ReportClientDocument();
// FLui: set the RAS server if you are using RAS
rpt.setReportAppServer( "localhost" );
rpt.open( "ras://C:\\Reports\\MyReport.rpt", 0 );
IReportSource rptSource = rpt.getReportSource();
viewer.setReportSource( rptSource );
frame.getContentPane().add( viewer, BorderLayout.CENTER );
frame.setSize( 700, 500 );
frame.setVisible(true);
viewer.start();
}
catch ( Exception exception )
{
System.out.println( exception.toString() );
}
}
public static void main(String[] args)
{
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
//
com.crystaldecisions.ReportViewer.ReportViewerFrame.main( args );
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
createAndShowGUI();
}
});
}
}
- 9
- MacOS X (was javax.usb)Steve W. Jackson wrote:
>>http://en.wikipedia.org/wiki/Macos#Mac_OS_X
>>
>>Mac OS X brought Unix-style memory management and pre-emptive
>>multitasking to the Mac platform. It is based on the Mach kernel and the
>>BSD implementation of UNIX, which were incorporated into NeXTSTEP, the
>>object-oriented operating system developed by Steve Jobs's NeXT company.
>>
>>Cheers,
>
>
> That's an interesting read, but it should not be taken as any form of
> "gospel" since it contains some inaccuracies of its own.
It's easily fixable, should you be so inclined. What's wrong with it
though - it's what I've read in the past, that MacOS X is the Mach
microkernel (tightly) wed to bits and pieces of a BSD (I'm not sure
which, I think FreeBSD or NetBSD).
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
- 10
- JTextArea append method doesn't always appendI have an application with many custom loggers, and a number of JTextArea
instances for displaying the log entries written to the loggers. Each
JTextArea has a thread associated with it that continuously pulls entries
out of a particular logger and appends that text to the JTextArea. Thus,
each entry written to a logger should show up in the associated JTextArea.
The problem I have is that not all the log entries show up in the text area,
and what shows up and what does not can change with each execution. I've
put print statements before and after the log statements, and before and
after the text area append, and all the expected log entries show up at all
those places. Only in the JTextArea is there variability in what shows up.
Is this a bug in JTextArea, or is this some known behavior?
--
=================
Lee Graba
email***@***.com
=================
- 11
- 2 nested result setOn 19 Gen, 03:41, Lew <email***@***.com> wrote:
> > A ResultSet object is automatically closed when the Statement object that generated it
> > is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
I've resolve usig two different statement.
Thank you so much (and to the java doc too :) )
- 12
- Automated Basic Authenication with an Applet for the Browser ?I like to automate web access to secure pages and proxies, which are
proteced with a Basic Authenication scheme.
The Basic Authentication within an Applet works really well, I get all
the information I need when I attach the
Authorization: Basic base64encodeUID_PW to the request Header.
or
if I use the Authenticator Class of the JDK1.5.
My problem is that the browser does not notice that I already have
a UID/Password combination for the desired web page.
When I did the same with a form based authorisation the URLConnection
was setting the Cookie inside the browser implicitly, the
showDocument() method displayed the secure page, because the browser
used the cookie to access it.
Is there any way to access the cache for the UID and Password of the
browser to set these values that when I invoke the showDocument() to
display the page inside the browser, I don't have to enter the UID and
Password again?
My current code to authenticate myself is this, I also tried a direct
socket connection and a HttpURLConnection there was no difference:
String urlString =
"http://www.demo.com/basicprotectedpage/index.html"
AppletContext appCont = getAppletContext();
//created password authenticator.
mmAuthenticator myPassAuth = new mmAuthenticator(uid,pw);
//setting password.
Authenticator.setDefault(myPassAuth);
//URL created.
URL url = new URL(urlString);
//opening connection
URLConnection conn = url.openConnection();
//setting do input and do output.
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(true);
//Data Input Stream
BufferedReader bin = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String inputLine;
System.out.println("web page data " );
while ((inputLine = bin.readLine()) != null)
System.out.println(inputLine);
bin.close();
appCont.showDocument(new URL(urlString)); // this should
display the secure page without the prompt for uid password
Thank you in advance. Have a nice day.
FB
- 13
- Signed applet problem with plugin 1.4.2Hi Java gurus,
I have an applet signed in JDK 1.4 jarsiner and using a Verisign code
signing key. It works nicely in Netscape & IE.
My troubles began when Sun upgraded to plugin 1.4.2_01-b06. When using
this plugin with IE, the applet still shows the "trust applet?" popup,
but when I click OK, an exception occurs as soon as the applet reaches
a privileged operation like system.getProperties(). I get
"SecurityControlException: access denied". This occurs in IE 5 and IE
6, on any platform I tested: XP, Win2000, Win98 etc. The applet still
works file on Netscape.
I also tried to sign the applet with JRE 1.4.2, but still IE denies
it.
Any clue?
Thanks in advance
Sruli Ganor
- 14
- Connection Pooling in Java application for interacting with Websphere MQI have following infrastruture at my site.
1> Machine #1 has below
- Websphere MQSeries 6.0 (client setup - Slim Client)
- OS = Windows 2003
- i/p address : 10.1.11.10
- Tomcat web server 5.5
- No Websphere Application Server.
2> Machine #2 has below
- Websphere MQSeries 6.0 (Server setup)
- OS = Windows 2003
- i/p address : 10.1.11.21
- Queue Manager Name : qMngr
- Queue Name (client will put the message) : toServerQ
- Queue Name (client will get the message) : fromServerQ
- I have developed the web application in Tomcat web server 5.5 using
MQ base classes for accessing the Websphere MQ.
- Since it is web application there can be atleast 25 request at
time.
i.e. when client#1 request data from queue he must get data related
to client#1 only not other than client#1.
- For accessing the websphere MQ, I am using websphere MQ base classes
in Client mode. (Not JMS)
==>>>> Source Code as follows
Class MQInterface (Servlet) is used for getting the web request from
user and reply the response in html format.
------------------------------------------------------------------------------------------------------
public class MQInterface extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String Output = "";
System.out.println("!! Entered into Banking Servlet !!");
String requestParam = request.getParameter("OPRN_CODE");
if (requestParam.equalsIgnoreCase("GET_NAME_DETAIL")){
String id = request.getParameter("id");
Output = MQDataObject().getNameDetail(id);
return Output;
}
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(Output);
}
Class MQDataObject is used for getting and putting data(message) into
Websphere MQ.
------------------------------------------------------------------------------------------------------
public class MQDataObject {
private String hostname = "10.1.11.21";
private String channel = "Chnl1";
private String qManager = "qMngr1";
private MQQueueManager qMgr;
private ISISSSLAdaptor ssl;
private ISISConfigHelper ConfigHelper;
private String Output;
public MQDataObject(){
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
MQEnvironment.sslCipherSuite =
"SSL_RER_WERH_3KIUD_EQW_CRT_SSA";
try{
ssl = new DEMOSSLAdaptor("DEMOSSLAdaptor.config");
ConfigHelper = new
ISISConfigHelper("MQConnection.config");
}catch(Exception exception){
System.out.println("Exception Details => " + exception);
}
}
public String getNameDetail(String sendMessage){
....
....
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
String msgText = "";
try
{
....
....
// Create a connection to the Queue Manager.
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open
int openOutOptions = MQC.MQOO_OUTPUT;
// Specify the queue to open and open option
MQQueue sendingQueue =
qMgr.accessQueue("toServerQ",openOutOptions,null,null,null);
// Define the MQ message and write some text in UTF
format
MQMessage sendingMessage = new MQMessage();
sendingMessage.writeUTF(sendMessage);
// Specify the message options..
MQPutMessageOptions pmo = new MQPutMessageOptions();
// Put message on the queue
sendingQueue.put(sendingMessage,pmo);
// Close Sending Queue
sendingQueue.close();
// Receiving the message back
// Wait for 5 seconds to get reply from receiving queue
Thread.sleep(5000);
// Set up the options on receiving queue we wish to open
int openInOptions = MQC.MQOO_INPUT_AS_Q_DEF |
MQC.MQOO_OUTPUT;
MQQueue receivingQueue =
qMgr.accessQueue("fromServerQ",openInOptions,null,null,null);
MQMessage receivingMessage = new MQMessage();
// Set and Get the message options
MQGetMessageOptions gmo = new MQGetMessageOptions();
// Receiving the message off the queue.
receivingQueue.get(receivingMessage,gmo);
// Get the message from the receiving queue.
msgText =
receivingMessage.readStringOfByteLength(receivingMessage.getMessageLength());
// Close Receiving Queue
receivingQueue.close();
// Close a connection to the Queue Manager.
qMgr.disconnect();
// Parse the received message using parser.
String output = new IFXXMLParser().runExample(msgText);
}
catch (MQException mqex){
System.out.println("MQ Error : " + mqex);
}
catch (Exception ex){
System.out.println("General Error : " + ex);
}
return Output;
}
}
The message for sending the receiving is in XML format.
Could any one help me following in questions.
1> Since there is 30 request at time so for improve the performance
and resources I need to do connection pooling.
How can I achieve this using base classes.
2> While retrieving (getting) the message for particular request how
can I identify the response message.
i.e. when client#1 request data from queue he must get data related
to client#1 only not other than client#1.
because In above scenario there are separate queues for getting the
message and putting the message.
I have read the tutorial on connection pulling but I am little
confused.
Thanking in Advance
Sanjeev
- 15
- keystroke latency patternsHi,
my name is Christian Seifert and I am graduate student as Seattle
University currently researching Keystroke Latency Patterns.
I would like to invite you to participate in the project by providing
me with your own keystroke latency patterns. I have created a data
collections java applet which can be accessed through the project site
at http://students.seattleu.edu/seiferc/independentStudies/index.asp.
Participating will not take longer than 5 minutes.
I have posted a message about a week ago and I would like to thank all
those who have participated. I am posting this again, because I need
much more data to create a valid algorithm.
Thanks for participating,
Christian Seifert
|
|
|