comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* execution speed java vs. C - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e8713e999b13b7d1
* Servlets sessions - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/47b1af11c896d424
* MIDP 2.0 and MMAPI video streaming on mobile phones - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c549aba7ddf5765c
* Simple problem - 4 messages, 4 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/78e14eea63ba6eea
* plugin & packages - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f8770143f9f32c9
* Mp3 converter to Wav - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2065cb5e577dbb91
* opinion on coding standard - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a
* Tool or IDE for function inlining - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/58fb84c0ecba12f0
* Serialization Problems and books on serialization? - 5 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8af88eceb230451c
* Desktop gets blurry when Java starts... - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ac3cec9e99944b9
* Tomcat 5 and JNDIRealm - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7e9e84f1d71fd010
* Invoking 'diff' from java with piped input - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f
* javax.activation.UnsupportedDataTypeException: no object DCH for MIME type 
multipart/mixed; - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b5401df24c783db2
* Displaying Struts <html:errors/> in javascript - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d1bced03e7a5db1
* LDAP character encoding - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cd78003c51f2560

==============================================================================
TOPIC: execution speed java vs. C
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e8713e999b13b7d1
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 8:20 am
From: Chris Smith  

Alex <[EMAIL PROTECTED]> wrote:
> Try to feed FFT code or something complex (search for Ooura FFT). I
> think you may get more real numbers, at least ~8-10 times slower java
> code.

Overall, I am still of the opinion that the average performance of top C 
compilers will beat the performance of Sun's Java virtual machine.  
However, eight to ten times is a ridiculous number.  Remember that 
extraordinary claims require extraordinary evidence.  You've provided no 
evidence at all.

My own experience, by the way, is that it's difficult to do TOO awfully 
much better than gcc -O3.  In fact, -O2 does reasonably well, and the 
difference between -O2 and -O3 is itself relatively small.  Intel's 
compiler can definitely generate better code on average for Intel 
platforms that gcc does, but the margin is *not* going to be several 
hundred percent.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: Servlets sessions
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/47b1af11c896d424
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 8:27 am
From: Chris Smith  

Xarky <[EMAIL PROTECTED]> wrote:
> Is in this way correct, because I was trying to set the data retrieved
> from the second servlet by using setAttribute(..);(without
> putValue(..) but then the name and surname being returned in 3rd
> servlet were being null.

putValue and setAttribute do exactly the same thing... but as you 
discovered, putValue is deprecated and should not be used.  As for why 
setAttribute wasn't working:

>       //session.setAttribute("presonName", name);
>       //session.setAttribute("presonSurname", surname);
>       session.putValue("personName", name);
>       session.putValue("personSurname", surname);

You misspelled "person" in the attribute name of your setAttribute 
calls.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: MIDP 2.0 and MMAPI video streaming on mobile phones
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c549aba7ddf5765c
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 4:31 pm
From: Alexander Willner  

Hi there,

"Mike Bundschuh: Remember, MMAPI is format- and protocol-agnostic, so 
you cannot assume QT or Real or MP3 format support. The API is flexible 
enough to handle those formats, but it all depends on whether the native 
code underneath supports them, and if the software integrator exposes 
those native services to MMAPI.".

I would like to stream videos on a mobile phone. Since Macromedia 
Flash-Lite is not powerful enough to handle video streams I want to 
implement the program with J2ME (does someone know any alternatives?). I 
found an example [1] to download and display an MPEG-1 video file with 
MMAPI. But I want to *stream* 3GPP (like H.263 or MPEG-4) content. How 
can I use the underlying native code (e.g. Symbian or Real Player) to 
embed a video stream?

Alex

[1]http://developers.sun.com/techtopics/mobility/midp/articles/mmapioverview/ 



-- 
Alexander Willner     [EMAIL PROTECTED] (e-mail)
Leinestr. 34          +49 178 4580614 (mobile)
37073 Goettingen      +49 551 9957462 (phone)
Germany               140 349 735 (icq)
                       www.alexanderwillner.de (web)
                       0x50FE9D32 (pgp-key)




==============================================================================
TOPIC: Simple problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/78e14eea63ba6eea
==============================================================================

== 1 of 4 ==
Date: Thurs, Dec 9 2004 4:33 pm
From: "stud"  

error:
'{' expected
'}' expected
what's wrong with my code?
Thanks!!

class insertFailException(String reason) extends SQLException
{
 public insertFailedException(String reason)
 {
  super (reason);
 }
 public insertFailedException()
 {
  super();
 }
}







== 2 of 4 ==
Date: Thurs, Dec 9 2004 7:41 am
From: [EMAIL PROTECTED] 

The class name does not have a parameter list. The syntax should be
<access control keyword> class className




== 3 of 4 ==
Date: Thurs, Dec 9 2004 8:59 am
From: "ctyberg"  

Also, aren't you missing the } at the end of your class?




== 4 of 4 ==
Date: Thurs, Dec 9 2004 5:23 pm
From: Joona I Palaste  

ctyberg <[EMAIL PROTECTED]> scribbled the following:
> Also, aren't you missing the } at the end of your class?

No.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"It sure is cool having money and chicks."
   - Beavis and Butt-head




==============================================================================
TOPIC: plugin & packages
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f8770143f9f32c9
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 9 2004 8:43 am
From: Chris Smith  

> VisionSet wrote:
> > My app uses plugins.  Plugins are written to implement an interface.
> > What is the normal way to specify the package with a plugin like this?

Chris Uppal <[EMAIL PROTECTED]> wrote:
> Why not just put a text (or XML) description of the plugin into the root
> directory (or the root of the JAR file) ?  That way plugin authors can use
> whatever package they like, and you don't have to scratch around searching the
> filesystem for .class files that /might/ correspond to plugin classes.

I've tended to do this differently; specifically, I'd designate a 
directory for plugins, and usually provide a property so that directory 
can be changed with a -D option to the VM.  That directory would contain 
JAR files, and there'd be a plugin description of some type in the META-
INF directory of those JAR files.  This has the advantage that the app 
can still scan for plugins at runtime, rather than someone having to 
maintain a global configuration files that specifies all of the plugins; 
and that you can keep information about a plugin bundled with that 
plugin itself, so that a plugin can be added or removed with as a single 
file.

IMO (to Mike) having loose class files around is just *really* asking 
for trouble.  JAR files are a nice way to take a set of code and bundle 
it all together.  With loose class files, you'd have to worry about 
identifying which classes are plugins and which are not; which classes 
belong to which plugins, and so forth.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 2 of 2 ==
Date: Thurs, Dec 9 2004 4:39 pm
From: "VisionSet"  


"Chris Smith" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

>
> IMO (to Mike) having loose class files around is just *really* asking
> for trouble.  JAR files are a nice way to take a set of code and bundle
> it all together.  With loose class files, you'd have to worry about
> identifying which classes are plugins and which are not; which classes
> belong to which plugins, and so forth.
>

It is a very simple demo app, I've got it working with the class files, and
I'm happy with it.  The directory is scanned for class files and a
Class.forName gets the class, if it is not assignable to my Inteface it is
rejected.  There is only one simple class implementation required.  If it
were more elaborate I'd go for jars.

Thanks each.

-
Mike W






==============================================================================
TOPIC: Mp3 converter to Wav
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2065cb5e577dbb91
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 7:45 am
From: "shakah"  

SoX may be of interest to you:

  http://sox.sourceforge.net/





==============================================================================
TOPIC: opinion on coding standard
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 8:58 am
From: Chris Smith  

Tim Jowers <[EMAIL PROTECTED]> wrote:
> Personally, I'd like to see better comments more than better
> formatting.

Absolutely not!  Comments at such a low level should be a last-ditch 
effort to explain something when you can't find any other way to express 
it in code.  Comments are to be encouraged taken at face value, but they 
are the least attractive of a large number of options.

> IME, stupid variable
> names and plain poor coding are MUCH harder to fix than weird
> formatting.

I agree that variable names and well-structured code are more important 
to get right than formatting.  However, something expressed through 
formatting is still expressed better than if it were written in 
comments.

Someone should organize the ABC (Anything But Comments) movement, named 
after the famous 1976 "Anybody But Carter" movement in the U.S. 
Democratic Party.  Hopefully, this movement wouldn't fail quite so 
spectacularly.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: Tool or IDE for function inlining
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/58fb84c0ecba12f0
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 11:00 am
From: "Eli"  

A new software engineering technique called Binary Refactoring
addresses this and other similar problems.

"Inline Method" is one of the binary refactorings supported
by BARBER, a reference implementation of
a binary refactoring browser for Java: http://j-orchestra.org/barber/.

Unfortunately, BARBER is a research prototype rather than
a production-quality software tool.

"Alex" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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.
>






==============================================================================
TOPIC: Serialization Problems and books on serialization?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8af88eceb230451c
==============================================================================

== 1 of 5 ==
Date: Thurs, Dec 9 2004 8:10 am
From: [EMAIL PROTECTED] 

> How exactly does it "fail"?

That's the strange thing. The function call never return. In other
words, it hangs the program. There are no significant CPU activity.

The following is the code sniplet for serialization used. model1 is the
objectB on previous message.

PipedOutputStream out = new PipedOutputStream();
PipedInputStream in = new PipedInputStream(out);
ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(model1);

It does not like the last line.

Just in case it's relevent, I am using Sun's java SDK 1.4.2
Thank you in advance
Sinlee




== 2 of 5 ==
Date: Thurs, Dec 9 2004 5:42 pm
From: Michael Borgwardt 
 

[EMAIL PROTECTED] wrote:

>>How exactly does it "fail"?
> 
> 
> That's the strange thing. The function call never return. In other
> words, it hangs the program. There are no significant CPU activity.
> 
> The following is the code sniplet for serialization used. model1 is the
> objectB on previous message.
> 
> PipedOutputStream out = new PipedOutputStream();
> PipedInputStream in = new PipedInputStream(out);
> ObjectOutputStream oos = new ObjectOutputStream(out);
> oos.writeObject(model1);
> 
> It does not like the last line.

I suspect that it has nothing to do with serialization at all and
that your write call just blocks because the buffer of the PipedInputStream
is full. You have to read it in a different thrad. If that's not it,
make an SSCCE: http://www.physci.org/codes/sscce.jsp



== 3 of 5 ==
Date: Thurs, Dec 9 2004 9:08 am
From: [EMAIL PROTECTED] 

Many Thanks for the info. It is a new lead for me. I will try to
investigate the buffer issue. Will probably takes some time. I will of
course report back when its done.

Best regards,
Sinlee




== 4 of 5 ==
Date: Thurs, Dec 9 2004 9:20 am
From: [EMAIL PROTECTED] 

I should add that what you suggests make sense because the problematic
serialization occurs generally on larger composite objects.

Your reply had lead me to think about how I serialize very large
object. upon inspection of the code, I see that I actually use
ByteArrayOutputStream and ByteArrayInputStream for very large object.
Will replace Piped*Stream with them and see what happens.
Best regards,
Sinlee




== 5 of 5 ==
Date: Thurs, Dec 9 2004 12:34 pm
From: Sudsy  

[EMAIL PROTECTED] wrote:
>>How exactly does it "fail"?
> 
> 
> That's the strange thing. The function call never return. In other
> words, it hangs the program. There are no significant CPU activity.
> 
> The following is the code sniplet for serialization used. model1 is the
> objectB on previous message.
> 
> PipedOutputStream out = new PipedOutputStream();
> PipedInputStream in = new PipedInputStream(out);
> ObjectOutputStream oos = new ObjectOutputStream(out);
> oos.writeObject(model1);
> 
> It does not like the last line.

Since I don't see any code (should be a separate thread) reading the
pipe, I'd guess that you're filling up the pipe. The capacity is not
infinite and you're probably blocking on the write.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==============================================================================
TOPIC: Desktop gets blurry when Java starts...
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ac3cec9e99944b9
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 9 2004 5:17 pm
From: "Mr B."  

I know, maybe not the best place to ask, but Im at the end of my wits.. so 
I'll try

When Java fires up ( only Sun, not MS ) desktop goes all blurry.
Launching Eclipse, NetBeans etc etc ( even just visiting a java supported 
site in IE6 ) starts the blurriness..

Uninstalling Java 1.4.2 and reverting back to whatever version comes with 
IE6 fixes the problem, but obviously I then can't use Eclipse and NetBeans

I think the problem started when I got my 6800GT, but I am not sure, and 
ofcause, no matter what driver the problem persists.
Apart from that WinXP Pro + SP2

Anybody seen this ?





== 2 of 2 ==
Date: Thurs, Dec 9 2004 9:34 am
From: Chris Smith  

Mr B. <[EMAIL PROTECTED]> wrote:
> When Java fires up ( only Sun, not MS ) desktop goes all blurry.
> Launching Eclipse, NetBeans etc etc ( even just visiting a java supported 
> site in IE6 ) starts the blurriness..
> 
> Uninstalling Java 1.4.2 and reverting back to whatever version comes with 
> IE6 fixes the problem, but obviously I then can't use Eclipse and NetBeans

That's definitely odd.  My guess is that it's a problem with the video 
card.  There are definitely known problems with the interaction of some 
1.4 versions of Java and some (especially ATI) video cards.  There are 
also options to prevent Java 1.4 and later from using graphics 
acceleration, and they might help.

Try http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html, but pay 
attention to the minimum supported versions for the flags (some are 1.5 
specific).

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: Tomcat 5 and JNDIRealm
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7e9e84f1d71fd010
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 4:26 pm
From: John English  

Not a Java question as such -- but I'm trying to configure Tomcat
to authenticate against an LDAP server, and have cast the following
magic spell in my <Context>:

   <Realm class="org.apache.catalina.realm.JNDIRealm" debug="99"
          connectionURL="ldap://ldap.bton.ac.uk:389";
          userPattern="uid={0},ou=People,dc=bton,dc=ac,dc=uk"/>

(I can't find anything to use as a role -- I don't care about roles
in this case, I just want to know if the username & password are OK.
However, the role-related parameters all seem to be optional according
to the Tomcat docs.)

I get a nasty error when the context starts up:

08-Dec-2004 11:34:06 org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.NullPointerException
        at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:769)
        at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
        at 
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
        at org.apache.commons.digester.Rule.begin(Rule.java:200)
        at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
        at 
org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)

         ... and so on ...

08-Dec-2004 11:34:06 org.apache.catalina.startup.HostConfig deployDescriptors
SEVERE: Error deploying configuration descriptor test.xml
java.io.IOException: java.lang.NullPointerException
        at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
        at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
        at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:968)
        at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
        at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:480)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

Can anyone tell me what I'm doing wrong here, and what the exception
really relates to?

-----------------------------------------------------------------
  John English              | mailto:[EMAIL PROTECTED]
  Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
  School of Computing & MIS | ** NON-PROFIT CD FOR CS STUDENTS **
  University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------




==============================================================================
TOPIC: Invoking 'diff' from java with piped input
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 10:40 am
From: Alan Gutierrez  

On 2004-12-09, David Kensche <[EMAIL PROTECTED]> wrote:

> Alan Gutierrez wrote:

>> On 2004-12-08, Michael Borgwardt <[EMAIL PROTECTED]> wrote:

>>>David Kensche wrote:

>>>>Hello,

>>>>I want to call GNU diff from a java class with the following command

>>>The other way would be to find and use a diff implementation in Java.

>>     Like, for example, the diff algorithm that comes with Eclipse.
>> 
>>     It is under org.eclipse.compare.
>> 
>>     I've extracted it for use with a testing framework. It is very easy
>>     to use, and it is cross-platform pure Java.

> my first implementation used jrcs but this was prohibitively slow in
> patching. This is why I decided to try GNU diff/patch. But to be honest
> I thought about trying eclipse instead but I was sure, that eclipse
> uses diff and patch as provided by the cvs installation. But if there
> is a java implementation, I will try this, too.

    Please share your experiences with all these different
    difference implementations. I'd like to know how the Eclipse compare
    algorithm compares to GNU diff and JRCS.

--
Alan Gutierrez - [EMAIL PROTECTED]





==============================================================================
TOPIC: javax.activation.UnsupportedDataTypeException: no object DCH for MIME 
type multipart/mixed;
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b5401df24c783db2
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 8:49 am
From: "Xeth Waxman"  

Hello:

I have been using Javamail to successfully send text messages.  I tried
adding attachments, and now I get this error:

javax.activation.UnsupportedDataTypeException: no object DCH for MIME
type multipart/mixed;

>From what research I have done, this is typically a classpath issue -
but I don't even have a classpath environment variable (on WinXP Pro),
and no other instances of mail.jar or activation.jar.  The application
is in a packaged jar which is invoked from the commandline with no
arguments - just java - jar <my jar here>.  I tried running it once
with the -classpath switch and including the actual path to the jar,
but it didn't make any difference.  Does anyone have any idea what this
could be?  I am completely stumped.  I'm sure you will probably need
more information, but I don't know what other information is needed -
just let me know and I'll get it up here :)  I've seen several other
forums with posts like this when I was trying to google an answer, and
the solution is always something along the lines of "check your
classpath", which isn't very useful to me or some other java newbies -
Check it for what?  Check it how?

--Xeth





==============================================================================
TOPIC: Displaying Struts <html:errors/> in javascript
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d1bced03e7a5db1
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 9 2004 12:07 pm
From: "Brian S. Paskin" 
 

Hi, I am trying unsuccessfully to display the <html:errors/> in a alert 
message in Javascript. I know I can display them on the screen, however, 
the client wants a popup box.  The problem is that <html:errors/> returns 
more than just the error messages.  Is there a way to just dislay the error 
messages?

Thanks,
Brian



== 2 of 2 ==
Date: Thurs, Dec 9 2004 9:43 am
From: Sudsy  

Brian S. Paskin wrote:
> Hi, I am trying unsuccessfully to display the <html:errors/> in a alert 
> message in Javascript. I know I can display them on the screen, however, 
> the client wants a popup box.  The problem is that <html:errors/> returns 
> more than just the error messages.  Is there a way to just dislay the error 
> messages?

Use <html:messages> instead.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==============================================================================
TOPIC: LDAP character encoding
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cd78003c51f2560
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 9 2004 9:43 am
From: "smirks"  

Hi,

I am retrieving some information from a Microsoft Active Directory
Server via Java's JNDI API.

In particular, I'm trying to get an attribute called 'objectSID', which
is of type Octet-String on the active directory.

My problem is that when trying to convert the returned value to a hex
representation, some of the bytes are incorrectly converted.

Let me explain further:

After performing a certain query on the ldap server, I read the
returned objectSID attribute by calling:

String value = (String) attrib.get();

...where attrib is the attribute containing the retrieved objectSID.

While debugging, I do a simple print out of the above string (using a
simple System.out.println(value)), to get the following byte
representation:

u?uT?`C
2?

I use Apache's commons-codec API to convert the above string to a Hex
represenation as follows...

String hex = new String( Hex.encodeHex(value.getBytes()) );

... and when I print it out, I get:

010500000000000515000000753f75540f3f601d43170a323f040000

However, the correct hex value as stored on the active directory server
when performing a certain query, should be as follows:

01050000000000051500000075b975540ff8601d43170a32e4040000

This is close, but not quite the correct value.

In fact, when I try to reverse the correct hex value to the byte
representation, I get:

u¹uTø`C
2ä

... which is therefore the actual value that I should be getting when
reading the naming attribute in the first place and casting it to a
String, right?

I believe the problem has to do with character encoding, but I don't
know how to proceed from here. I have tried various character sets when
converting 'value' to a byte array above, but to no avail.
Any help will be greatly appreciated.

Regards,
Clyde




==============================================================================

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 

Reply via email to