| Clever way to change fonts on the fly...?? |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Customized form authentication with JSPLongwinded explanation ahead--I want to make sure I don't leave any
important details out.
I'm maintaining a client/server system that we use for automated grading of
student CS assignments. The basic
architecture consists of the grading server app itself and a servlet client
for student access, which runs on Tomcat in our case. Right now, the
servlet is starting to get large, as it's hardcoded to print one of several
pages depending on a URL parameter, and I'd like to break this into several
JSP pages instead.
We don't use any kind of standard authentication method in the servlet. The
servlet login page accepts the student's username/password as well as the
course they're enrolled in (chosen from a list), and we authenticate this
inside doGet() by passing a custom message object to our grading server,
which checks whether the student is enrolled in the course they chose, as
well as whether their username/password is valid. If their information is
valid, we store it in the HttpSession object and use that as they navigate
the site.
The problem is, I'm not sure how to translate this into JSP. I've seen some
examples using j_security_check, j_username, etc., but from what I can tell,
it looks like those are handled completely by the webserver, and requires
the user information to be stored in some file that the webserver can
access. This isn't a solution for us, because the grading server may not
even be on the same physical machine as the webserver.
So basically, here's what I'm looking for: A form-based authentication
method that lets me verify the student's username, password, and course
enrollment all at once, and store that in a session that I can use across
all the JSP pages. Obviously, I'd like all the pages to be protected so
they redirect to the login page if the user isn't logged in this session,
and I'd also like to be able to handle situations where if the session times
out and the user tries to navigate, it returns him to the login page, and
then redirects him to whatever original page he was trying to navigate to
when he successfully logs in.
From scouring other newsgroup posts, it looks like I might need to create my
own custom Realm (?), but I'm not sure where to start. I'd also like
something that's not tied specifically to Tomcat, but would work on most
popular JSP-supporting webservers, if possible.
If anyone can give me some advice or a push in the right direction, I'd
really appreciate it!
Thanks,
- 6
- Getting plugin info from internet web serverHi,
I have written an application that is used for programming
flash/SRAM devices that are soldered to a PCB. The application is written
in Java, and I have split the functionality between the main application
and plugins that can be user selected then loaded. Currently I have 3
different plugins, for programming devices via JTAG and via a serial port.
What I would like to do is download information relating to the
plugins (version, dependencies, jar filename etc) and the plugins
themselves (packaged as jar files) from the internet. I plan to include a
file manager in my main application to access this information from a web
server, so that a user of the software doesn't have to manually download
plugins and copy them to the appropriate place in their local filesystem.
In addition, the file manager will also be able to check that the plugins
on a user's systems are the latest, compared to those available on the
web server.
My question is what is the easiest way to do this? If possible, I would
like to keep the web server side as simple as possible.
Thanks,
Paul Taylor.
--
Remove _rem_ before replying by email.
- 9
- font.properties.zh_TW for 1.4.2
--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
The font.properties.zh_TW file in native jdk14, inherited from
native jdk14 does not work as expected, and here is the right one for
it. Could you merge this into the next patchset?
Thanks!
--
Clive Tong-I Lin <email***@***.com> | http://tongi.org | PGP KeyID: A008C03E
--AqsLC8rIMeq19msA
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
--AqsLC8rIMeq19msA--
- 11
- JVM automatic updatesTwice now, I rave rejected a prompt to update the JRE in the morning
before I go out. On both occasions the PC was also on in the evening
(for longer periods) but the the prompt did not appear.
Can anyone confirm that Java only requests updates in the morning?
--
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
- 11
- find windows folderHi all! I have a question about Java and Windows systems...It's possible to
obtain the exact path of windows installation folder using Java functions? I
need this to be valid on different versions, from Win98 to WinXP
Thanks at all! Massimo
- 11
- how to pass this before supertype constructor has been calledPaul J. Lucas wrote:
> No I don't. I can do what I want in C++ just fine. As long as
> I don't try to access anything *through* "this" I'm fine. It'd
> perfectly safe. It's 100% portable. It just works.
Paul, there's really no answer then, other than "go use C++ and do it".
You can't do what you're asking in Java. Your winning an argument isn't
going to change your compiler and magically let you do it. You will
simply need to allow the initialization to be completed from within the
derived class's constructor, because you can't just reference this when
defining the parameters to the superclass constructor.
Maybe you think that you should be able to do so, and of course it would
be possible to define a language similar to Java in which you could, but
when you're working in Java, you can't.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
- 11
- 12
- jar helphi
i have been trying to make a jar file for the following files
hello.java
hello.class
with the following command
jar cf hello.jar hello.*
it is created and with
jar tf hello.jar
i am able to see the list of files which is in this case
META-INF/
META-INF/MANIFEST.MF
hello.class
hello.java
but it doesn't run with
java -jar hello.jar
following error appears
Failed to load Main-Class manifest attribute from
hello.jar
i tried to fix it with
jar cfm hello.jar mymainclass hello.*(after creating mymainclass with the
entry Main-Class: path.hello)
to no avail!
and another thing is although the dir META-INF is shown as above it is not
created in the folder..where is it created??
help please
Greetingz
Sunil
- 12
- Irony (not that you'll see this subject anyways)On Aug 4, 11:09 am, Joshua Cranmer <email***@***.com> wrote:
> In terms of off-topic-ness, the first posts started delving into
> implementing operator overloading, which then started into a discussion
> over exponentiation operators -- both of which are mildly on-topic. Then
> came a response by Twisted saying that COBOL was responsible for a lot of
> Y2K bugs.
Which was a perfectly "on-topic" reply to the previous post. It's
called topic drift. Get used to it.
[snip remainder]
Stop blaming me. It is never correct to blame me; leave me in peace.
- 12
- Huge titted pornstar Danielle Derek teaches a teen how to fuck Just few link on some movies...
All just for you...
Download
>>>>> http://download-video.12w.net
>>>>> http://world-sex.urllogs.com
>>>>> http://video-sex.12w.net
CLICK FREE DOWNLOAD VIDEO PORN...
L
I
C
K
T
O
W
A
T
C
H
V
I
D
E
O
P
O
R
N
D
O
W
N
L
O
A
D
F
R
E
E
.
.
.
W
E
L
C
O
M
T
O
M
O
V
I
E
S
P
O
R
N
D
O
W
N
L
O
A
D
.
.
.
- 12
- GUI simple pong newbieHello i have just recently finished completing the code to a simple applet
that bounces a ball around the screen i am just wondering what it would
take to turn that into a pong program where would i set up the method for
the paddles and how to i distinguish between events of ball movement key
pressing and collisions?
--
Message posted via http://www.javakb.com
- 12
- ports/113467: Multiple "missing return value" errors buildingThe following reply was made to PR ports/113467; it has been noted by GNATS.
From: "Robert Backhaus" <email***@***.com>
To: email***@***.com, email***@***.com
Cc:
Subject: Re: ports/113467: Multiple "missing return value" errors building JDK on current
Date: Tue, 3 Jul 2007 13:14:32 +1000
Confirming that this is still an issue with current patchset. I am
bootstrapping with diablo-jdk-1.5.0.07.01_5 for freeBSD 6 (from
ports).
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 12
- using proguard for lib jarsI need to shrink app jar itself and lib jars too, but it dosent work.
I have unpacked jars into a dir, put app classes threre and made a big jar.
Then i used proguard but it still didnt work.
- 13
- Problem to download a file from 2 browsers at the timeI have this JSP that download an excel file.
It works fine if I use only one browser at the same time.
The problem is when I try to do this but from 2 browsers at the same
time. From each browser I can download a part of the file but not the
complete file.
It seems the browsers are sharing the bandwidth and when it starts to
download a file the other stops.
I have look the logs, and I saw the file has downloaded to the computer
and while the the jsp is working.
I don't undestand why the file has finished to download and while the
jsp is still executing.
Can you help me please?
do anybody try this JSP and tell me if the result is the same as me?
------------------------------------------JSP
-----------------------------------------------------------------------------------
<%@page contentType="application/vnd.ms-excel"%>
<%@ page language="java" import="java.io.*"%>
<%@ page language="java" import="java.util.*"%>
<%
Date fecha = new Date();
java.sql.Date fechaSQL = new java.sql.Date(fecha.getTime());
Calendar calendario = Calendar.getInstance();
calendario.setTime(fecha); // fecha es el Date de antes.
String strHour = String.valueOf( calendario.get(Calendar.HOUR) );
String strMinute = String.valueOf( calendario.get(Calendar.MINUTE) );
String strSecond = String.valueOf( calendario.get(Calendar.SECOND) );
String nombre = "FILE" + strHour + strMinute + strSecond + ".xls";
System.out.println( " IN OF " + nombre );
response.setContentType( "application/x-download" );
response.setHeader("Content-type","application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment; filename=\""
+ nombre + "\"");
System.out.println( nombre + " START" );
for (int l=0;l<30000;l++){
System.out.println( nombre + " " + l );
for (int k=0;k<250;k++){
out.write(nombre + " : ("+ l + "," + k + ")" + "\t" );
}
out.write("\n");
}
System.out.println( nombre + " END" );
%>
- 13
- NetBeans to abandon Java ? It makes you wonder...Today I was directed to a satisfaction survey on the NetBeans website
after starting NetBeans 6. I expresses my disdain about the product,
said that the current setup does not allow me to get my work down (I'm
still using NB 5.5.1 for my Java development) but that I have to admit
that the whole documentation as well as the overall speed is satisfying.
Then I got curious to the end results of the survey, couldn't find any,
but I did stumble upon this page with lots of success stories about
excited developers who've (re)discovered NetBeans:
http://www.netbeans.org/servlets/NewsItemView?newsItemID=1179.
After reading that whole page I was basically left with one simple
question: "And what about Java?".
I quote from the page: "Developers continue to rave about NetBeans 6.0
IDE features--its support for Ruby and C++, the debugger, the easy
installation process and more.". There isn't much changed with regards
to the installation, NB5.5.1 also has a good debugger and then what ?
Reading on there are a few success stories. Funny though how those
reflect on the IDE as a whole, RoR or C++. Reading on again we see 4
more stories: "Amazing RoR support", "Cleaner, slimmer, more focused IDE
than Eclipse" and finally "A lot of features".
Cool. SO like, why am I wondering why I don't read so many success
stories which are fully related to Java ?
Heck, here I am utilizing NB6 as we speak to debug a PHP powered
website, and its doing a pretty good job as well, apart from the
sometimes very annoying delays its causing me. But thats a minor issue,
and only happening very sporadically.
Still... Is NetBeans shifting their focus ? I have to wonder. It would
explain something about my horror experiences where (IMO) important Java
related features like autocomment (javadoc administration) and pattern
support (javabean administration) were removed. While I don't consider
NB6 to be a decent Java editor I have to admit its doing well on PHP.
Errr... I think I'll stop here :P
With kind regards,
Peter
|
| Author |
Message |
Mark Thornton

|
Posted: 2003-8-6 3:31:00 |
Top |
java-programmer, Clever way to change fonts on the fly...??
blah wrote:
> All the various Swing componets I use have their "font values" set to a
> global font that is discovered in a config file when my app loads up. Now
> if I change the value, my application needs to be restarted in order to get
> the new font.
>
> I know I can go around and manually set the new chosen font into each and
> every component... but I'm wondering if there's an easier way to handle all
> of this...
>
> Anyone face this or have any suggestions?
>
>
Swing gets its fonts via UIManager. Override the default values and then
follow the procedure for changing the Look And Feel.
|
| |
|
| |
 |
sandipchitale

|
Posted: 2003-8-7 0:57:00 |
Top |
java-programmer >> Clever way to change fonts on the fly...??
"blah" <email***@***.com> wrote in message news:<zfTXa.418$email***@***.com>...
> All the various Swing componets I use have their "font values" set to a
> global font that is discovered in a config file when my app loads up. Now
> if I change the value, my application needs to be restarted in order to get
> the new font.
>
> I know I can go around and manually set the new chosen font into each and
> every component... but I'm wondering if there's an easier way to handle all
> of this...
>
> Anyone face this or have any suggestions?
Something like this may work:
import java.awt.Font;
import java.awt.Frame;
import java.awt.Window;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
public class SwingFontManager {
public static void changeDefaultFont(Font font) {
UIManager.put("Button.font",font);
UIManager.put("ToggleButton.font",font);
UIManager.put("RadioButton.font",font);
UIManager.put("CheckBox.font",font);
UIManager.put("ColorChooser.font",font);
UIManager.put("ComboBox.font",font);
UIManager.put("Label.font",font);
UIManager.put("List.font",font);
UIManager.put("MenuBar.font",font);
UIManager.put("MenuItem.font",font);
UIManager.put("RadioButtonMenuItem.font",font);
UIManager.put("CheckBoxMenuItem.font",font);
UIManager.put("Menu.font",font);
UIManager.put("PopupMenu.font",font);
UIManager.put("OptionPane.font",font);
UIManager.put("Panel.font",font);
UIManager.put("ProgressBar.font",font);
UIManager.put("ScrollPane.font",font);
UIManager.put("Viewport.font",font);
UIManager.put("TabbedPane.font",font);
UIManager.put("Table.font",font);
UIManager.put("TableHeader.font",font);
UIManager.put("TextField.font",font);
UIManager.put("PasswordField.font",font);
UIManager.put("TextArea.font",font);
UIManager.put("TextPane.font",font);
UIManager.put("EditorPane.font",font);
UIManager.put("TitledBorder.font",font);
UIManager.put("ToolBar.font",font);
UIManager.put("ToolTip.font",font);
UIManager.put("Tree.font",font);
Frame[] frames = Frame.getFrames();
for (int i = 0; i < frames.length; i++) {
SwingUtilities.updateComponentTreeUI(frames[i]);
// the following could be recursive
Window[] windows = frames[i].getOwnedWindows();
for (int j = 0; j < windows.length; j++) {
SwingUtilities.updateComponentTreeUI(windows[j]);
}
}
}
}
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Bombay to Bangkok wallpapers
Alibaug , Bombay to Bangkok, Sunday,Tashan ,Meera Bai Not Out
Aaja Nachle , Bhool Bhulaiyaa , Dus Kahaniyaan , Go , Goal , Jodhaa
Akbar ,
Johnny Gaddaar , Mumbai Salsa , Singh is King ,Taare Zameen Par ,
Nanhe Jaisalmer, No Smoking , om shanti om , Rama Rama Kya Hai
Dramaaa , Saawariya ,
Singh is King, Race ,Good Luck ,Halla Bol ,Strangers, Gauri,
Jab we met,Welcome, Karzzzz
And maney more .................
visit http://www.desktopatoz.com for nice And houge collection of
wallpapers. its amazing websit for wallpapers
enjoy
http://www.DesktopAtoZ.com
- 2
- unreachable statement??Hi, the following is the snippet from my code. My question is that if
i change the position of the return statement ("return SS") with the
"System.out.printf("S ==%d\n", SS)", then i get the error message of
"unreachable statement". Could anyone explaina what this is??
Thank you. Jonie
public int getDoublets () {
for (int i = 0; i < numNodes; i++) {
GayNode node = (GayNode) agentList.get(i);
String string = node.getInfectStatus();
ArrayList list = node.getOutEdges();
for ( int j = 0; j < list.size(); j++) {
GayEdge edge =(GayEdge)list.get(j);
GayNode otherNode = (GayNode)edge.getTo();
String otherString = otherNode.getInfectStatus();
if (string.equals("s") && otherString.equals("s")) {
SS += 1;
} } }
System.out.printf("SS =%d\n", SS);
return SS;
}
- 3
- How do I get rid of the print options from JavaHelp 2.0M.Hamer wrote:
...
> I posted a similar message on comp.lang.java.help so I'm sorry if
> you're having to read it again but I've had no responses from that
> group and I need this bit done quickly.
What, you lose money if the contract
is late? Elance it! I am confident they
would care about your deadline.
> I've just downloaded the JavaHelp 2.0 zip file as part of an ongoing
> investigation and implementation within our coding standards. I work
> for a company that does software for the military and as such the
> software we create is classified. There was a security issue with
> JavaHelp 1.1.3 in that we couldn't easily remove the print option.
> With JavaHelp 2.0 is there a way of disabling the print options? We
> cannot have the ability to print out the help as it carries the same
> classification as our software.
Here's a thought.
Ensure the user and software are physically
in the same place, make that place secure.
A double tumbler money safe should do
the trick.
Lock the safe, and drop in over the side of
a ship positioned above a deep ocean trench.
That should keep the data (relatively) safe.
- 4
- New EC200 embedded Java controller releasedSnijder Micro Systems just announced the public release of the second
generation of their Embedded Java?Controller (EJC? product line,
codenamed EC200.
The EJC is a family of embedded controllers that implement a
full-fledged Java platform for network-enabled and standalone
applications. The new EC200 modules provide an Ethernet based
connection to the Internet and numerous interfacing possibilities
including graphic LCD display, digital I/O, analog inputs, high speed
serial ports, dual I2C bus, Dallas 1-Wire, etc.
The software integrates Tao Group's intent?technology, featuring an
advanced Real Time Operating System and a Sun-certified Java Virtual
Machine (JVM) that combines unrivalled performance with minimal
footprint, due to the tight integration between kernel and JVM and to
the advanced translation technology which compiles all Java bytecode
to native code before execution. Java APIs are provided for efficient
access to hardware resources such as I/O ports, system memory and
memory-mapped devices, interrupts, and onboard peripherals. This
allows developers to adopt an all-in-one approach where applications,
system components, and even device drivers can be written entirely in
Java, without compromising on flexibility or performance.
More details can be found in the EJC website:
http://www.embedded-web.com/
- 5
- regarding JDk 141 and JDK 122 for linux 64 bit PlatformHi All.
I am porting my application from 32 bit linux to 64 bit linux. For
my application i am using JDK 122 and JDK 144. Do these versions have
downloads available for 64 bit linux. If yes, Please let me know from
where i can get these downloads,
Thanks in advance.
Ranjan
- 6
- cvs emailHi there
I have 2 computer, one is winxp and eclipse (java IDE) is install on that
machine (192.168.1.100), and the other machine is Linux (fedora) -ip
192.168.1.100) and the cvs installed there.. I did the following to install
cvs
>yum search cvs
>yum install cvs
Then I did the following configuration
I logged on as a root
1) went to /home and create a folder called cvs
2) I did this --> export CVSROOT=:local:/home/cvs
3) then --->cvs init
4) created a file /etc/xinetd.d/cvspserver and put the following
service cvspserver
{
socket_type = stream
wait = no
user = root
group = cvsgroup
env = HOME=/cvsrepo # Fixes RHL 7.0 problem!
server = /usr/bin/cvs # Or path to your cvs binary
server_args = -f --allow-root=<your cvs ropos root> pserver
disable = no
}
5) I did the following
service xinetd stop
service xinetd start
Then I went to the cvs client (Eclipse) and configure it as the following
-host: 192.168.1.101
-repository bath: /home/cvs
-user: me (sometime i used root too)
-password: whatever
-connection: pserver
I got error message "communication error" (could not connect to
192.168.1.101)
Any help would be very much appreciate it . Thank a lot.
- 7
- JUnit, writing todo tests...
Does anyone know if its possible to write "todo" tests with Junit?
That is tests which are expected to fail because they have not been
implemented yet, but will not actually show up as a failure.
The perl test harness implements this and it's very useful because you
can use it to mark up tests for functionality that you are going to
implement but have not yet.
Cheers
Phil
- 8
- Servlet location question(s) - ** FIXED **
PJL <email***@***.com> wrote in message
news:email***@***.com...
> Using Tomcat 4.1.30 on Win XP Pro
>
> Given the following:
> -----------------------------------------------------------------
> <servlet>
> <servlet-name>SrvLog</servlet-name>
> <servlet-class>ServerLog</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>SrvLog</servlet-name>
> <url-pattern>/Test0005</url-pattern>
> </servlet-mapping>
url-pattern should be "/ServerLog", I guess it is based on the notion that
the "ROOT" is "Test0005" which is the directory under the "..../webapps"
directory. So, "jakarta-tomcat-4.1.30/webapps/Test0005" is the actual root
path of my website.
Couldn't see the forest for trees on that one.
I'm a newbie, can you tell??
Thanks all,
PJ
> -----------------------------------------------------------------
>
>
> Where must the servlet "ServerLog.class" reside in order for it to run?
>
> I do not have any package statements in "ServerLog.class"
>
> I have tried putting it in the "WEB-INF/classes" directory of "Test0005"
and
> calling "localhost:8080/Test0005/ServerLog" I get a 404 error.
>
> I have tried putting it in the "Test0005" directory and I also get a 404
> error.
>
>
> Any ideas?
>
> Regards,
>
> PJ
>
>
- 9
- [SUN] Take Sun Security Course and Get a Digital CameraReceive a free digital camera by registering for one of
Sun's online security courses during the month of October.
To receive your free digital camera, register for one of the
following courses:
* Administering Security on the Solaris Operating System
* Network Security Using SunScreen EFS
* Trusted Solaris 8 System Administration
* Enterprise Security Assessment and Best Practices
* Solaris Network Intrusion Detection
* Enterprise Security Deployment and Management
To learn more and register, go to:
http://training.sun.com/suned/us/security-training?ssobm=ng
- 10
- Exception in thread "AWT-EventQueue
Ive got a swing application with quite a lot of code. With several JFrames
being created at various stages.
Its working fine but sometimes Im getting a ClassCastException ,copied
below, at no
predictable time or place in my code.So I cant find the source of the
problem with normal debugging.
Anybody any ideas on how to find the problem here??
TIA
patrick
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
at javax.swing.LayoutComparator.compare(LayoutComparator.java:72)
at java.util.Arrays.mergeSort(Arrays.java:1284)
at java.util.Arrays.mergeSort(Arrays.java:1296)
at java.util.Arrays.mergeSort(Arrays.java:1295)
at java.util.Arrays.mergeSort(Arrays.java:1295)
at java.util.Arrays.mergeSort(Arrays.java:1296)
at java.util.Arrays.sort(Arrays.java:1223)
at java.util.Collections.sort(Collections.java:159)
at
javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:119)
at
javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:425)
at
javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:148)
at
javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:502)
at
java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:149)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:318)
at java.awt.Component.dispatchEventImpl(Component.java:3841)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:93)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
- 11
- Struts--dynamic input param?I'm just getting started in Struts, and have hit an issue. I have a user
registration screen which I'd like to use for new users to register and for
existing users to view and update their information. No problems so far. My
question concerns what happens if the user presses the "Cancel" button. I
use <html:cancel /> to place it, then use the isCancelled method in my
DispatchAction to detect it. I was planning on calling the same method
(save) for both creating and update a registration, but then how do I know
where to go on a Cancel? Is there a way around this or should I use two
different methods? It just seems like it would be code duplication. Not to
mention that I'd have to come up with a way to dynamically create a form
action to point to the appropriate method. That's why I'm wondering if
there's a more elegant solution.
- 12
- For those Deprived Of HomeworkNot everyone is fortunate enough to have the money to pay professors
to think up homework problems for them. For the rest of you who are
new, and think you need the exercise, here is a problem for you to
tackle:
There are even simpler ones at:
http://mindprod.com/projects/beginner.html
Predator Prey
This exercise teaches basic Collections and generics. Pick an
ecosystem. Create a set of Species objects that contain some facts
about each species such as name and average adult weight in k.g. Now
accept facts about predator and prey relationship encoded with a
method:
public static void eats( String predator, String prey );
There should be a method:
public static Species[] whoEats( String prey )
and there should be a method:
public static Species[] whoIsEatenBy( String predator )
and finally:
// All Species heaviest first
public static Species[] speciesByWeight()
Implement the predator->prey and prey->predator lookups with
one-to-many mappings using a HashMap keyed by species name whose value
is an ArrayList of Species that you maintain in sorted order by
species name. When you insert, use Collections. binarySearch to find
the new insertion point.
Implement speciesByWeight using a Collections.sort rather than a
TreeSet. Make sure you include all species, without duplicates.
For bonus points, implement:
public staticSpecies[] whoIsIndirectlyEatenBy( String predator )
Watch out for endless recursion.
Note that I have not told you all the pieces you will need to create
to solve the puzzle. I am not totally spoon feeding you in this
exercise.
see http://mindprod.com/jgloss/comparable.html
http://mindprod.com/jgloss/hashmap.html
http://mindprod.com/jgloss/binarysearch.html
http://mindprod.com/jgloss/sort.html
http://mindprod.com/jgloss/arraylist.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 13
- FormLayout constantsHello,
I've just begun using FormLayout (migrating from TableLayout), and
it's great. But all the examples I've seen use hardcoded strings to
describe the layout; for example,
FormLayout layout = new FormLayout
("10dlu, pref:grow",
"pref, 3dlu, pref, 3dlu, top:pref:grow");
My question is, what is the canonical approach to defining constants
for those values that I know I'll reuse ("3dlu" above is always going
to be the space in between rows). Is this the right way:
FormLayout layout = new FormLayout
("10dlu, pref:grow",
"pref, " + ConstantSize.DLUY3 + ", pref, "
+ ConstantSize.DLUY3 + ", top:pref:grow");
I suppose that's not bad too bad, so maybe I've just answered my own
question. I guess what I'd really like is simply to see more code
examples of people using FormLayout. Thanks!
Jared
- 14
- Java Regular Expression throws StackOverflow ExceptionI was just trying to use a regular expression for finding me the
patterns which match
X(\\n|\\r|.)*? Y
What this means is to find the pattern which matches any String that
starts with X followed by any number of characters or new lines or new
carriage returns and finally followed by Y.
To summarize find the pattern which matches the block X ........ Y
which can be separated by any characters/newlines/tabs etc.
Ex:
X
AFJALFJA
Y
should be selected.
When i use the pattern shown above the java prog throws me
StackOverflow exception. Can you throw me some light into
pattern/expression modification??
Thanx
Sravan
- 15
- java/69733: [new port] java/eclipse-sysdeo-tomcat, SysdeoSynopsis: [new port] java/eclipse-sysdeo-tomcat, Sysdeo Eclipse Tomcat Launcher plugin
Responsible-Changed-From-To: freebsd-java->nork
Responsible-Changed-By: nork
Responsible-Changed-When: Thu Jul 29 03:04:20 GMT 2004
Responsible-Changed-Why:
I'll handle this.
http://www.freebsd.org/cgi/query-pr.cgi?pr=69733
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
|
|