Jonathan Smiths

Greenhorn
+ Follow
since Jan 29, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jonathan Smiths

Using Spring Webflow, I'm trying to get the output of a JSP for PDF generation (following the hints at http://blog.valotas.com/2011/09/get-output-of-jsp-or-servlet-response.html)

The normal redirection to JSP accepts a HttpServletRequest and a HttpServletResponse, but my Webflow JSP expects a Webflow RequestContext. (for commandnames e.g.)

I tried copying the attributes to the HttpServletRequest, but this will not fully work, as the commandName of a form is not available.

Is there any recommended way to manually pass a webflow context to a jsp?
3 years ago
I'm building a JEE6 project on a Glassfish server and I'm trying to authenticate in the following way:

-Use the JOpenId library to authenticate with Google Server
-Redirect to a servlet that requests Google Oauth2 access
-Redirect to a JSF index page that is restricted to authenticated users.

I could manually build authentication in every single webservice, web servlet and JSF page, but it's easy to forget this security rules, so I'd prefer to use a security mapping in web.xml.
As far as I can see however, the build in security provider is pretty limited to custom programmatic authentication. I don't want to use the predefined "form" authentication of Glassfish either, because I'm already using openid.
I'm trying to achieve something like this, but without form login.
http://stackoverflow.com/questions/9082208/programmatically-add-roles-after-authentication
When I try to edit an javax.security.auth.Subject object, it throws me a 'subject is read-only' error.

Any help on this one?
5 years ago
Thank you very much, I will definitely try the test commands of Spring Roo!
6 years ago
Dear Ashish Sarin,

I have installed Springsource Tool Suite and I have created a basic Spring Roo project.
For my internship I try to create unit tests first and develop against my tests. (test-driven development)

Is it possible to let Spring Roo automatically generate tests for my methods? Or to generate the methods based on the tests?

Next to that, I am looking to extend the capabilities of Spring Roo by add-ons, but I couldn't find a single, central source for new addons. Did I overlook a website?

Thanks in advance.

EDIT: one extra question. After making some mistakes in the roo shell I am wondering if there is, or if there will be an undo function in the roo shell?
6 years ago
Will mr Williams still be active in answering questions today?
Or is it just the announcement of the winner that is postponed.
6 years ago
Hi Mr. Williams,

I just finished a course on concurrency at my study.
It appeared to me that while concurrent software can be much more efficient than other software, it is really hard to debug.
I often got really unpredictable errors or errors without any error message while programming concurrent software in C++.

Are there any debuggers specifically designed to debug concurrent software that you can recommend to me?

If not so, what is a good way to get a grip on debugging concurrent software manually?

How would you test concurrent software, knowing that there is often a small chance the threads could interfere, which may not show up the first time testing?

Thanks in advance,

Jonathan
6 years ago
I think you should use a Swing Timer.
http://www.java2s.com/Tutorial/Java/0240__Swing/SwingTimers.htm This is a simple example.
Remember to pass the time in milliseconds, so 5 secs would be a parameter 5000 to the timer.
7 years ago
bump, anyone experience with the expandbar?
7 years ago
Hi all,

I am trying to create an application with multiple chats for some kind of support system.
Therefore I use a tabfolder with two tabitems, one with answered threads, one with new threads.
On each of the tabitems I have an expandbar with multiple expanditems (with chatboxes on them)
My problem lies in moving a thread to the 'read' tab. I have to move the expandItem, or remove and recreate it. However, there are no functions for removing, hiding or moving expanditems, expandbars or tabitems.
I searched for information on the expandbar of swt, but I could hardly find any forum threads about this widget. Am I trying to do something that's not possible? How could I try to solve this problem?
7 years ago
I'm not exactly sure how to get a full stacktrace in Eclipse, I will search that out later.
For now I've solved my problem, I loaded the wrong main class in the html file.
Thanks for the reply.
7 years ago
Hey guys ,

I am trying to make some kind of scrolling shooter in java.
Therefore I want to create an applet, capable of running in a browser.
My applet is running just fine when used in development environment Eclipse.
When I try to run the applet in the browser (firefox) however, I got the following error:



I use multiple JPanels for a login screen and a home screen. My applet is signed to obtain rights for reading files.
There is nothing in the error message that gives me a clue on what the problem is with the code.
The project is too big to post all the code. If you'd need some code to help me, please be specific on which code it has to be.
7 years ago
I was trying to install an add-on in firefox for the java-console functionality. I will try to find an integrated console.
I have included "tinylaf.jar" in the buildpath, that's the only configuration I did.
In my php/html file I included the following code:


In my Applet I included:


I uploaded the jar in the directory of the applet and tried the following code:

And err... it works right now

Thanks for the help
8 years ago
I would really like to use a theme I created in TinyLaf in my applet.
I created the applet which sets the look and feel to "de.muntjak.tinylookandfeel.TinyLookAndFeel".
When I run the applet in eclipse, everything is fine, the theme is just normally loaded.
When I try to run the applet in firefox, the system default theme is used.
I tried to include a .jar of TinyLaf, I tried uploading the complete workspace of the applet, nothing helps.
I can not get a java-console working in firefox, to view any output or exceptions. Add-ons with a java-console are not supported anymore.
There is very little information/tutorials about TinyLaf on the internet. Could anyone please help me with setting up a TinyLaf theme in an applet?
8 years ago
I am using SWT to create a GUI for my program.
I have a shell with a tabFolder with two tabItems.
Each of the tabItems controls a different table, so I have two tables in total.
Every 5 minutes I update the contents of both of the tables.
I searched for a way to customize the color of a selected item in a table, and I found information regarding SWT.EraseItem to make this possible.
I used this snippet:


Here is my problem:
When I have selected table2 (tabItem2), and my tables are updated, the first table, table1 gets focus, you can only see table1, though the selected tabItem appears to be tabItem2.
I hope my problem is clear to you, so when updating the tables, the eraseItem listener causes the first table to appear even if the second table is selected.
8 years ago
I am trying to create a table object with two columns.
The table should be flexible in width, based on the width of the contents of it.
I do this using column.pack() and table.pack().
However, the table never "really" packs, there is always some space right to the second column.
Also there is some space below the lowest table item, about the size of half an item.
I can not use fixed width for the table. How can I get rid of that extra space on the right side and the bottom?
8 years ago