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

Today's topics:

* Server to use with JMF? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5385de1842e9e5c8
* ActiveX Container in Java - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/188085b06e48f3d1
* Auto submit Struts form every 'n seconds - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f1db635d5081dd3
* JavaMail - SMTP - Exchange Server Authentication - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e33c67570bd15c77
* Debugging java sevlet with Eclipse - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/12f04f6042558518
* How to initialize a big (String-)Array fast? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a849e4e56de0eae
* [OT] Re: Java speed vs. C++. - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523
* Thoughtsworks Job Interview? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821
* "static" prefix - to parallel "this" prefix - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157
* HttpSession expired vs. invalidated - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dbbb2dba35e4659b
* Can Java Programmer Learn C++ Quickly? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec
* looking for eclipse plugin for user management in RCP application - 1 
messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dd7f8897a1463dc8
* Need help w. the JSTL c:out tag. - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2bb8e9c8c521f2fd
* JNDI InitialContext problem - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8f7e20a7ce68b0a7
* Beginning EJB - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d49babfdb472b21c
* Sockets - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edecab678cd31cd6
* Tomcat 5, EL Expressions in jsp:inlcude - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4da7307e1d9d37b9
* math.pow rounding problem - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3e00e118892196bb
* (OT) Re: Using hobby source code in your job ? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4

==============================================================================
TOPIC: Server to use with JMF?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5385de1842e9e5c8
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 5:41 pm
From: Andrew Thompson  

On Mon, 06 Dec 2004 17:31:14 GMT, ted holden wrote:

> ..JMF..

You might also try the JMF mailing list..
<http://www.physci.org/codes/javafaq.jsp#interest>

-- 
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: ActiveX Container in Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/188085b06e48f3d1
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 6:37 pm
From: "Chris Uppal"  

Dan wrote:

> Has anyone seen anywhere an ActiveX container written in Java?

You might want to look at commercial products like J-Integra and JNIWrapper
(Google should find both for you).

There may well be other commercial offerings, and I know that there are some
free alternatives too (but can't remember any names).

If neither of the above suits your needs, and if you can't find anything
better, then you can create your own.  To do that is conceptually simple,
although I suspect the details would be messy.  You need:

    (1) to learn how to program COM and ActiveX in C or C++.
    (2) to learn how to use Java's facility for calling C/C++ code, which is
        called JNI.
    (3) to put the two together.

(2) and (3) are probably easier than (1), but I can't say for sure since I
don't do COM.  Also (3) might be tricky -- or even difficult -- if you want to
mix visual ActiveX controls with Swing components.

    -- chris






==============================================================================
TOPIC: Auto submit Struts form every 'n seconds
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f1db635d5081dd3
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 10:41 am
From: "Nate"  

I don't think stuts has any built-in functionality for this, but you
could easily implement this using Javascript on your jsp (that your
struts form is using).





==============================================================================
TOPIC: JavaMail - SMTP - Exchange Server Authentication
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e33c67570bd15c77
==============================================================================

== 1 of 1 ==
Date: Tues, Dec 7 2004 2:54 am
From: Rico  

A principle to bear in mind no matter how frustrated one might feel:
when the problem seems to have reached the most complex extremity, it's
time to approach it from the other end of the spectrum.

"And of course don't forget to set the mail.smtp.auth property to true to
 enable SMTP authentication!"

Rico.

On Sun, 07 Nov 2004 04:10:39 +0800, Rico wrote:
> From the JavaMail docs:
> 
> ------------------------------------------------------------------
> public void connect(java.lang.String host,
>                     java.lang.String user,
>                     java.lang.String password)
>              throws MessagingException
> 
> Throws:
>     AuthenticationFailedException - for authentication failures
>     MessagingException - for other failures
>     IllegalStateException - if the service is already connected
> ------------------------------------------------------------------
> 
> I call this method with a known wrong password for that host and username,
> there is no exception thrown at all. Have I misread something?
> 
> The server is an Exchange Server that ThunderBird and MS Outlook and
> Outlook Express have no problem using as SMTP server to send emails out to
> wherever.
> 
> JavaMail sends the email through to only addresses from the same domain as
> the SMTP server (set to allow relaying upon successful authentication),
> regardless of authentication.
> 
> Am I missing something?
> 
> Rico.





==============================================================================
TOPIC: Debugging java sevlet with Eclipse
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/12f04f6042558518
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 10:49 am
From: [EMAIL PROTECTED] 

http://jroller.com/page/mikemaruffi/Weblog?catname=/Java





==============================================================================
TOPIC: How to initialize a big (String-)Array fast?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a849e4e56de0eae
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 11:00 am
From: "Tim"  


Perhaps you'll want a memory mapped file so you can have a buffer and
the OS can futz with allocating RAM and swapping.
http://javaalmanac.com/egs/java.nio/CreateMemMap.html?l=rel

I think Linux has some kernel function for allocating memory clear or
initialized with the over-write bits. Windows probably does too. No
idea if Java supports this level of functionality. Anybody know?

So, I don't know any tricks to allocate large RAM cleared in Java. Any
luck finding out how?




== 2 of 2 ==
Date: Mon, Dec 6 2004 4:48 pm
From: "John C. Bollinger"  

Tim wrote:

> Perhaps you'll want a memory mapped file so you can have a buffer and
> the OS can futz with allocating RAM and swapping.
> http://javaalmanac.com/egs/java.nio/CreateMemMap.html?l=rel

Not relevant.  The problem Michael was pointing to is that a Pentium 3 
(or IV) cannot even address enough memory to handle distinct Strings (of 
any content, including empty) for all 64 million positions of the array 
the OP presented.  There is no OS magic for addressing larger memory 
than the supported address space of the processor, even ignoring such 
piddling questions as limits on the size of supported memory-mapped 
blocks (64MB in some common implementations -- barely more than enough 
for 64 million undelimited one-character strings).

> I think Linux has some kernel function for allocating memory clear or
> initialized with the over-write bits. Windows probably does too. No
> idea if Java supports this level of functionality. Anybody know?
> 
> So, I don't know any tricks to allocate large RAM cleared in Java. Any
> luck finding out how?

Java specifies how the contents of new arrays are to be initialized.  It 
is the JVM's job to handle the details, and a quality JVM implementation 
will make use of available features of the platform to do so as 
efficiently as possible while remaining within the constraints of 
allowable behavior.


John Bollinger
[EMAIL PROTECTED]




==============================================================================
TOPIC: [OT] Re: Java speed vs. C++.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 2:15 pm
From: Mike Smith  

Chris Smith wrote:

> Ann <[EMAIL PROTECTED]> wrote:
> 
>>>Off topic, but Win XP doesn't even have command.com :)
>>
>>--------- ya does ---------------
> 
> 
> Yes, Windows XP does have a command.com.  However, it is not used for 
> anything, and the code probably hasn't been maintained for years.  
> Making use of it yourself is very ill-advised.

Since we're already way OT - the WinXP command shell (the so-called "DOS 
prompt") is called CMD.EXE.  It looks a lot like COMMAND.COM, but it's not.

--
Mike Smith



== 2 of 2 ==
Date: Mon, Dec 6 2004 8:25 pm
From: red floyd  

Mike Smith wrote:
> Chris Smith wrote:
> 
>> Ann <[EMAIL PROTECTED]> wrote:
>>
>>>> Off topic, but Win XP doesn't even have command.com :)
>>>
>>>
>>> --------- ya does ---------------
>>
>>
>>
>> Yes, Windows XP does have a command.com.  However, it is not used for 
>> anything, and the code probably hasn't been maintained for years.  
>> Making use of it yourself is very ill-advised.
> 
> 
> Since we're already way OT - the WinXP command shell (the so-called "DOS 
> prompt") is called CMD.EXE.  It looks a lot like COMMAND.COM, but it's not.
> 
> -- 
> Mike Smith

Yeah, but the best WinXP command shell is called BASH.EXE, and you get 
it from cygwin.




==============================================================================
TOPIC: Thoughtsworks Job Interview?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 7:58 pm
From: "Virgil Green"  

"Anzime" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nus wrote:
> > How was the interview with Thoughtworks?
> >
> > MarathonMan wrote:
> >
> >>Hi,
> >>
> >>Any one interviewed with Thoughtworks for a Java position? Whats been
> >>your experience? And how tough are their coding tests during
> >
> > interview
> >
> >>process. Im thinking about applying to Thoughtworks.
> >>
> >>Thanks,
> >>--Anil
> >
> >
>
> If you have to worry about "coding tests" you need to code.

The "coding tests" question intrigues me. Since I haven't interviewed for a
job in over 15 years, I'm curious to know what kind of coding test typically
would be used for a Java position. Are the interviewers interested in your
ability to write good code in a timely fashion using the tools of your
choice (or similar), or are they interested in whether you've memorized
every class and every method signature in the standard libraries and can
crank out code in Notepad?

What kinds of experiences have readers encountered?

 - Virgil





== 2 of 2 ==
Date: Mon, Dec 6 2004 4:36 pm
From: Eric Sosman  

Virgil Green wrote:
> "Anzime" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
>>Nus wrote:
>>
>>>How was the interview with Thoughtworks?
>>>
>>>MarathonMan wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>Any one interviewed with Thoughtworks for a Java position? Whats been
>>>>your experience? And how tough are their coding tests during
>>>
>>>interview
>>>
>>>
>>>>process. Im thinking about applying to Thoughtworks.
>>>>
>>>>Thanks,
>>>>--Anil
>>>
>>>
>>If you have to worry about "coding tests" you need to code.
> 
> 
> The "coding tests" question intrigues me. Since I haven't interviewed for a
> job in over 15 years, I'm curious to know what kind of coding test typically
> would be used for a Java position. Are the interviewers interested in your
> ability to write good code in a timely fashion using the tools of your
> choice (or similar), or are they interested in whether you've memorized
> every class and every method signature in the standard libraries and can
> crank out code in Notepad?
> 
> What kinds of experiences have readers encountered?

    I can't recall ever taking or administering a coding
test as such.  I've been asked for samples of code I'd
already written, I've been asked coding-related questions
like "What's a coroutine?", and once very long ago I was
given a "programming aptitude test."  But I've never been
asked to sit down and code something, nor have I asked any
interviewee to do so when I was hiring.

    The problem is time.  Anything that can be coded from
scratch in ten or fifteen minutes is going to be pretty
simple, certainly far short of the degree of difficulty
attached to the prospective job.  Discovering that somebody
knows how to code a Heapsort or doesn't know how to code a
Gaussian elimination doesn't really tell you all that much.
Yes, you'll weed out the outright liars who claim to be
experts and truly know nothing at all, but I hope you have
more efficient ways of accomplishing that task -- the poseurs
ought never even to get an interview.

    But fashions change, and I haven't been on either end of
the hiring process for some years; maybe tests are now in
vogue, despite their shortcomings.  Personally, I used to
prefer asking the interviewee what projects he'd worked on
and then drilling down on a few of them: "That sounds disk-
intensive; were there performance problems?  How did you
attack them?  What gains did you get?  In retrospect, could
they have been avoided with a different architecture?  How
did the problems you struggled with on Project X influence
your design and coding decisions on the subsequent Project Y?"
I felt this gave me a better idea of the person's potential
to be helpful than would any number of prime finders.

-- 
[EMAIL PROTECTED]





==============================================================================
TOPIC: "static" prefix - to parallel "this" prefix
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 9:02 pm
From: Oscar kind  

Tim Tyler <[EMAIL PROTECTED]> wrote:
> I've been playing with the Checkstyle "Require this" check.
> 
> http://checkstyle.sourceforge.net/config_coding.html#RequireThis
> 
> This forces you to distinguish between local variables,
> instance variables and static variables in you code -
> buy using "this.var" for all instance variables and
> "Classname.var" for all static variables.  It (optionally)
> does the same for all method calls.
> 
> Essentially, I like the effect - but it highlights the need
> for a static prefix in Java to match the "this" prefix.
> 
> Just as "this." refers to the instance, the static
> modifier would refer to the class in which it appears.

No it does not. A static instance / method exists only in the class that
defines it. Not in the subclasses. That the compiler resolves them anyway
is IMHO a bug, even though it is convenient (i.e. syntactic sugar).

Remember however, that a static method does not have an instance attached
to it. It's just some random code, grouped with a class because it happens
to look nice. For a static method, there is no instance, no class, etc.
The only reason you are still "inside" a class is because of the scope of
the block the definition happens to be in.

It is of course possible to change all this, but this would create an
enormous change in the underlying structure of the language. It's easier
to create and market a new programming language than to fix the problems
this would create.


-- 
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



== 2 of 2 ==
Date: Mon, Dec 6 2004 8:21 pm
From: Tim Tyler  

Oscar kind <[EMAIL PROTECTED]> wrote or quoted:
> Tim Tyler <[EMAIL PROTECTED]> wrote:

> > I've been playing with the Checkstyle "Require this" check.
> > 
> > http://checkstyle.sourceforge.net/config_coding.html#RequireThis
> > 
> > This forces you to distinguish between local variables,
> > instance variables and static variables in you code -
> > buy using "this.var" for all instance variables and
> > "Classname.var" for all static variables.  It (optionally)
> > does the same for all method calls.
> > 
> > Essentially, I like the effect - but it highlights the need
> > for a static prefix in Java to match the "this" prefix.
> > 
> > Just as "this." refers to the instance, the static
> > modifier would refer to the class in which it appears.
> 
> No it does not. [...]

I am well aware that it doesn't *today*.

It was a *proposal* - and clearly presented as such, IMO.

> A static instance / method exists only in the class that
> defines it. Not in the subclasses. That the compiler resolves them anyway
> is IMHO a bug, even though it is convenient (i.e. syntactic sugar).
> 
> Remember however, that a static method does not have an instance attached
> to it. It's just some random code, grouped with a class because it happens
> to look nice. For a static method, there is no instance, no class, etc.
> The only reason you are still "inside" a class is because of the scope of
> the block the definition happens to be in.
> 
> It is of course possible to change all this, but this would create an
> enormous change in the underlying structure of the language. [...]

Actually the proposal would not break any existing code. FWIW, I would
describe it as a rather cosmetic change.  For instance it could be
implemented quite effectively rather trivially using a preprocessor.

The only things affected would be programs that automatically parse
code - and they can be updated - as Tiger clearly demonstrated.
-- 
__________
 |im |yler  http://timtyler.org/  [EMAIL PROTECTED]  Remove lock to reply.




==============================================================================
TOPIC: HttpSession expired vs. invalidated
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dbbb2dba35e4659b
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 2:05 pm
From: "William Brogden"  

On 6 Dec 2004 07:26:53 -0800, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have a session holding user data of an online survey. When the survey
> is completed, all data is written to a result file. After that the
> session is manually invalidated (servlet calling the invalidate
> method).
>
> If the respondent does not complete the interview the session times out
> at some point. I would like to flush the data I have in the session so
> far to a special result file.
>
> Is there a way of reacting to session expiration (by the server) and
> not to invalidation (by the servlet)?
>
> Using HttpSessionListener.sessionDestroyed(HttpSessionEvent se) does
> not work, because the data of HttpSessionEvent.getSession() is not
> accessible any more when the event is fired. Furthermore the
> HttpSessionEvent is fired when the session expires and when the session
> is manually invalidated.

The answer is simple, make your class that holds the survey
results implement HttpSessionBindingListener - each instance
will then be notified when it is being unbound from the session
and it can then save the data itself.

Bill



== 2 of 2 ==
Date: Mon, Dec 6 2004 9:37 pm
From: "Silvio Bierman"  

It is simple and obvious.

You must create a single object that holds the session status including ALL
your variables. It might even contain methods.

Something like this:

class SessionObject implements HttpSessionBindingListener
{
   //all session state represented in private members
  public void doGet(HttpServletRequest req,,HttpServletResponse resp)
  {
    //handle get-response for this session
  }
  public void doPost(HttpServletRequest req,,HttpServletResponse resp)
  {
    //handle post-response for this session
  }
  public void valueBound(HttpSessionbindingEvent event)
  {
    //handle session-initialization
  }
  public void valueUnbound(HttpSessionbindingEvent event)
  {
    //handle session-cleanup
  }
}

Program your sessions through this class or something based on the same
idea. In your servlet create the sessions as you already do, populating each
session with EXACTLY ONE session object if it is a new session. For each
existting session (and also for the newly created ones) use the session
object to delegate the get/post messages to.

Simple, clean and as efficient as it gets. Putting application properties in
a session is not smart, simply put a session facade object in.

Hope this helps,

Silvio Bierman






==============================================================================
TOPIC: Can Java Programmer Learn C++ Quickly?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 6 2004 3:18 pm
From: "Rhino"  

I realize that this is not entirely a Java question but I am hoping that
some of the people reading this newsgroup are Java programmers who went on
to learn C++.

I am giving some thought to applying for some jobs that want people with
Java and C++ experience. I have been writing Java for several years and am
fluent enough that I don't have to post questions here very often. I have no
real C++ experience and not much C experience for that matter.

However, the core Java statements are "borrowed" from C and C++ has often
been called "C with classes". It seems to me that it shouldn't take very
long to get up to speed on C++ if I am already fluent with Java and have at
least some knowledge of C. Then again, I understand that Java and C++ use
classes a bit differently; for instance C++ allows multiple inheritance
while Java allows only single inheritance but allows for multiple interfaces
as compensation. I'm not sure how long it would take to get fluent with
multiple inheritance after several years with Java.

I'd be very curious to know how long it took people here who were fluent in
Java to get fairly fluent in C++ if they started with approximately the same
skills I have today.

-- 
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare





== 2 of 2 ==
Date: Mon, Dec 6 2004 9:49 pm
From: "FunkyKarma"  

I programmed in C++ 10+ years before programming in Java now for 5+ years.

While I think the transition from being a good object oriented C++
programmer to Java was relatively easy, I don't think that going the other
way will be quite as easy.

What working with Java will hopefully bring to the table is practice in
applying sound OO principles, and to some degree syntax.  C++ and C provide
a much bigger opportunity to hang yourself especially with pointer / direct
memory manipulation.

Also, you need to be very familiar with your machine architecture to be
really good a debugger on a given platform.







==============================================================================
TOPIC: looking for eclipse plugin for user management in RCP application
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dd7f8897a1463dc8
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 3:23 pm
From: "Rhino"  


"Dominik" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm about to develop a rich client platform application that needs a
> role-based user management.
>
> - create/change/delete new users,
> - setting permissions for access to resources,
> - resolve permissions resulting from multiple and/or nested roles and
> - storing this information in a database
>
> as these features are being used in many multi-user applications to
> restrict access to funtions and/or data, i thought there might
> allready exist an eclipse plugin providing this functionality.
>
> so if anyone knows of such a plugin, or can give me a hint where to
> find one, i'd appreciate your posting.
>
Have you tried the Eclipse site, eclipse.org? I think they list many (or
all) of the plugins available for Eclipse somewhere on the site.
Alternatively, the eclipse newsgroups are bound to be helpful (assuming you
can figure out which one to post to!). You have to register to use the
newsgroups but it is free and only takes a second to get an ID and password;
then you can search the newsgroup archives for what you want; if you don't
find it, you can post to the newsgroup and someone will point you to what
you want if it exists.

Rhino






==============================================================================
TOPIC: Need help w. the JSTL c:out tag.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2bb8e9c8c521f2fd
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 9:09 pm
From: Steve Burrus  

I hate to "betray" my ignorance of what you told/instructed me to do, 
 >>"Wrap your Date in a bean class with get and set methods."<< but how 
  exactly do I go about doing that anyway??! I really haven't had much 
experience with working with the JSTL in a JSP file, i.e., all of the 
various jstl tags like the "<c:out>" and the others. So how do I "wrap" 
the Date in a bean class to where the final result will be the display 
of the time/date in my browser?

Heiner Kücker wrote:
> Steve Burrus wrote
> 
>>I  need help w. the JSTL c:out tag!! I am just simply trying to get the
>>current date printed out in a JSP page, but it won't show/display! All
>>that it shows in the web browser is the <h2></h2> heading and then under
>>that this :  ${date}, instead of the date that I would like to see. Here
>>is the code for this file :
>>
>>  <%-- use the 'taglib' directive to make the JSTL 1.1 core tags
>>available --%>
>><%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>><%-- use the 'jsp:useBean' standard action to make the Date object
>>available in page scope --%>
>><jsp:useBean id="date" class="java.util.Date" />
>><html>
>><head><title>First JSP</title></head>
>><body>
>><h2>Here is today's date</h2>
>><c:out value="${date}" />
>></body>
>></html>
>>
>>Thanx in advance to anyone who can help me with this problem.
> 
> 
> The java.util.Date class is no bean (has no get and set methods).
> Wrap your Date in a bean class with get and set methods.
> 




==============================================================================
TOPIC: JNDI InitialContext problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8f7e20a7ce68b0a7
==============================================================================

== 1 of 1 ==
Date: Tues, Dec 7 2004 8:17 am
From: "Kyle"  

Thanks, Juha.
Your reply is of great help.
In addition, I found a context.xml file where the jdbc/Public resource is
defined. This justifies the jdbc/Public lookup.
Kyle






==============================================================================
TOPIC: Beginning EJB
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d49babfdb472b21c
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 9:46 pm
From: Collin VanDyck  

Darryl L. Pierce wrote:
> Collin VanDyck wrote:
> 
>>> I heard a rumor that EJB is now "old hat." Can anyone confirm?
>>>
>> EJB 2.x is certainly awful in a lot of ways.  As has been mentioned, 
>> 3.0 should take away a lot of the pain, and I'm really looking forward 
>> to it!
> 
> 
> What, specifically, would you consider to be painful about 2.x? 
> Especially with 2.1, I find it to be a breath of very useful fresh air. 
> 1.x was painful, sure, but 2.x has been quite useful and IMO powerful a 
> tool to use.
> 

I was not around for 1.x, and with regards to 2.x the home/remote stubs, 
  interface implementation, etc.. In other words, I think working with a 
Hibernate-esque solution for persistence seems like a lot easier way of 
working with EJB.




==============================================================================
TOPIC: Sockets
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edecab678cd31cd6
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 9:56 pm
From: "FunkyKarma"  


> If you're communicating with sockets, it doesn't matter if the two
programs are
> written in different languages.
>

It does matter...

For example java.net.Socket doesn't implement out-of-band communication (at
least not the last time I checked).  If your C/C++ app uses that socket
feature then you are screwed - unless you can find and use another Java
socket wrapper than what comes with the JDK.






==============================================================================
TOPIC: Tomcat 5, EL Expressions in jsp:inlcude
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4da7307e1d9d37b9
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 2:01 pm
From: "John C. Bollinger"  

Mark F wrote:

> Tomcat 5
> 
> I would like to create my JSPs as all XML like so:
> 
> <?xml version="1.0" ?>
> <jsp:root version="2.0"
>   xmlns:jsp="http://java.sun.com/JSP/Page";
>   xmlns:f="http://java.sun.com/jsf/core";
>   xmlns:h="http://java.sun.com/jsf/html";>
> <f:view>
>   <f:verbatim><![CDATA[<!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>]]>
>   </f:verbatim>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <jsp:include flush="false" page="../inc/head.jspf">
> <jsp:param name="title" value="Logout"/>
> </jsp:include>
> <body>
>   <f:loadBundle basename="general" var="msg"/>
>   <f:loadBundle basename="logout" var="logoutmsg"/>
> <jsp:include flush="true" page="../inc/topnav.jspf"/>
> <jsp:include flush="true" page="../inc/header.jspf"/>
>   <h:form>
>     <h:panelGrid>
>       <h:outputText value="#{logoutmsg.loggedout}"/>
>       <h:outputText value="#{logoutmsg.closebrowser}"/>
>     </h:panelGrid>
>   </h:form>
>   <jsp:include flush="true" page="../inc/footer.jspf"/>
> </body>
> </html>
> </f:view>
> </jsp:root>
> 
> Unfortunately the EL code in the included JSPs is not being evaluated.
> 
> It works fine if I use the <[EMAIL PROTECTED]> directive but this is not XML 
> compatible.
> 
> Any help would be appreciated.

I don't see any reason why EL code would not be executed in the 
jsp:included JSPs, but you should recognize that those JSPs will run 
within their own page contexts.  That affects the scripting elements 
available to them and the disposition of scripting elements that they 
may create.  Those issues are not relevant to JSP code included via 
<[EMAIL PROTECTED]> -- could they be the source of your problem?  If not, then 
you will probably get more help if you provide a simple but *complete* 
example that exhibits the undesired behavior, along with a detailed 
description of the desired alternative.


John Bollinger
[EMAIL PROTECTED]




==============================================================================
TOPIC: math.pow rounding problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3e00e118892196bb
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 2:02 pm
From: "Boudewijn Dijkstra"  

"Chris Uppal" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
> Babu Kalakrishnan wrote:
>
> [...]  So in that sense the answer is "wrong", and Chris's option
> (a) holds.  However I wouldn't follow him in calling pow()
> "broken" since it is actually returning the /second/ closest
> double to the correct answer (the one just above rather than the
> one just below), and that is acceptable according the contract of
> pow() since it is within one "ulp" of the mathematically correct
> answer.

So all is swell now, and we can continue to live happily ever after.






==============================================================================
TOPIC: (OT) Re: Using hobby source code in your job ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 6 2004 2:07 pm
From: "Martin Harvey (Demon account)"  

On Sun, 05 Dec 2004 00:17:36 -0800, Jim P <[EMAIL PROTECTED]>
wrote:


>You are only one part of the company and a small part of it.

This is true, but the previous poster does have a point. People's
remuneration is *not* linked to how much they contribute to the
company. It's just like any good old "dominance" social heirarchy -
because actual contribution and value is downright impossible to
quantify, you end up having a career ladder & pay scales, and all of a
sudden they right conditions exist for something like the Peter
principle to apply.

He has another point which is that you are always paid less than you
are really worth. Why? Because if everyone was paid what their
contribution is really worth, the company would never make a profit.
It's that simple.

Anyway, ditching all the rhetoric, it boils down to this:

There is a tradeoff. The tradeoff is *risk*. You may say that your
employer is screwing you, but, the assumption is that a decent sized
organisation is less likely to have to ditch you than you are to make
a hash of your own start up. Not only that, but if things go belly up,
in a big company, you're not likely to be personally liable for
losses. 

Now, the reason the people at the top get paid loads is that
(ostensibly!) they're meant to have the market and financial judgement
to be able to chart a course for the company that keeps the numbers in
the black and the employees employed and paid - and here's the point:
if they *do* do that, then they're *worth* the (comparitively) large
salaries they're paid.

What really annoys me is when they screw it up or show obvious signs
of having *no clue*, and *still* get paid that much.

Anyways - practical advice: If you don't like being an "underpaid
minion", then start up your own company, and see what the other side
of the coin is like. Oh yeah, and be prepared to work 100 hour weeks
for the next 4-5 years.

MH.



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

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