Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Busty Sinclair

Greenhorn
+ Follow
since Jun 06, 2002
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 Busty Sinclair

Hi all

I have a struts application that uses JAAS to login,I use FORM authentication. I have a menu button on the home page you see after login on which I have placed a role. This is fine when I login as usual using the login form.

However, we have one client who wants to use single sign on. I have a link from their landing page to the application where I pass the username and password to j_security check as parameters:
action/home/j_security_check?j_username=joe&j_password=joespwd

This works fine apart from one thing, the button on which I have placed the role is not visible. Yet when I click on the 'Home' link within the application, it now shows the button. So it seems that bypassing the login page this way skips some step that enables the button. The strange thing is that the role that enables them to login is the same as the one used to enable the button. The app detects the role and enables them to login but doesn't display the button..

any ideas would be GREATLY appreciated!
13 years ago
Hi Dave
Thanks for your reply. Sorry, I didn't give enough info there. I am using J2EE, JBoss3.0.6 bundled with Tomcat. I use FORM authentication to log in, as you may or may not know, when using FORM authentication, your form must submit to 'j_security_check' and the web.xml indicates which loginmodule to use, the underlying servlet the form submits to is not visible so I dont actually know what way to use the loginModule to login programmatically.
I know that theres something about populating a callback handler within the loginContext before calling the Modules Login function but I am not sure how to go about this.
I tried the following but it just told me the password was incorrect...which it wasn't so its not working but I've no idea why:

If you can point me in the right direction, I'd really appreciate it.
Thanks
B
[ February 18, 2004: Message edited by: Busty Sinclair ]
14 years ago
Hi
I have extended the JAAS UsernamePasswordLoginModule for my login. I have a console where I change the logged in users password. This results in the need to login again to do anything else, presumably cos the principal no longer matches whats in the DB.
So, can I get the Subject and update the relevant Principal or add a new Principal to the Subject with the new password? If so, how do I get the current Subject?
Any suggestions would be greatly appreciated
14 years ago
I thought there might be some struts way I could include which property to sort on. Mark, your 2nd approach seems to be what I need, I'll write a comparator class. Thanks for the replies all. B
14 years ago
I want to sort the list in the following select on the budgetName property, can I do that within struts?
If not and I sort the list of javabeans in the collection before going onto the page, is it guaranteed that the beans would be accessed in order?

Any suggestions would be appreciated
thanks
B
[smilies disabled by moderator]
[ October 24, 2003: Message edited by: Junilu Lacar ]
14 years ago
Sorry, I should have made that clearer.
fieldA and fieldB are : NUMBER (12,2)
while fieldC is : NUMBER (16,6)
thanks for the reply
[ August 27, 2003: Message edited by: Busty Sinclair ]
Hi Mark
I am using an Oracle thin driver, I'll try the OCI one though to see if it affects my prob.
thanks for your reply,
B.
14 years ago
Hi
During insertion of a row, I am having a problem with 2 fields: fieldA and fieldB,
both are type NUMBER and are set programmatically as double,
fieldA is programmatically set to 99.0 while fieldB is set to 1.0
both are being set to the same scientific no in the DB which changes upon each insertion , e.g 1E-29
Whats really wierd is fieldC which is also set programmatically to 99.0, is a double and a NUMBER in the DB is set fine.
fieldC precedes the other 2 in the SQL stmt.
The oracle trace output shows that the container has passed on the correct values to the driver.
I tried the explicit setting of the field type in jbosscmp-jdbc but it didn't help.
I can insert through TOAD successfully, it appears to be the driver but I'm using the latest one.
I am using Oracle 9i with driver ojdbc14.jar, JBoss3.0.6, and am using container managed persistence
Any help would be GREATLY appreciated!
14 years ago
Hi
During insertion of a row, I am having a problem with 2 fields: fieldA and fieldB,
both are type NUMBER and are set programmatically as double,
fieldA is programmatically set to 99.0 while fieldB is set to 1.0
both are being set to the same scientific no in the DB which changes upon each insertion , e.g 1E-29
Whats really wierd is fieldC which is also set programmatically to 99.0, is a double and a NUMBER in the DB is set fine.
fieldC precedes the other 2 in the SQL stmt.
The oracle trace output shows that the container has passed on the correct values to the driver.
I tried the explicit setting of the field type in jbosscmp-jdbc but it didn't help.
I can insert through TOAD successfully, it appears to be the driver but I'm using the latest one.
I am using Oracle 9i with driver ojdbc14.jar, JBoss3.0.6
Any help would be GREATLY appreciated!
14 years ago
Hi
During insertion of a row, I am having a problem with 2 fields: fieldA and fieldB,
both are type NUMBER and are set programmatically as double,
fieldA is programmatically set to 99.0 while fieldB is set to 1.0
both are being set to the same scientific no in the DB which changes upon each insertion , e.g 1E-29
Whats really wierd is fieldC which is also set programmatically to 99.0, is a double and a NUMBER in the DB is set fine.
fieldC precedes the other 2 in the SQL stmt.
The oracle trace output shows that the container has passed on the correct values to the driver.
I tried the explicit setting of the field type in jbosscmp-jdbc but it didn't help.
I can insert through TOAD successfully, it appears to be the driver but I'm using the latest one.
I am using Oracle 9i with driver ojdbc14.jar, JBoss3.0.6
Any help would be GREATLY appreciated!
I am trying to forward from one action to another, but the forward goes to the correct JSP byt bypasses the action, which sets relevant info for the page, so causing an error.

struts config


tiles

I've also tried using the '.do' I've seen here in other posts but had no success

Any help would be greatly appreciated
B.
14 years ago
Thanks you two,
I had quadruple checked the struts config info against the form info but no luck.
My mgr came to me this morning with a new design for the page layout again anyway and now the two forms are on diff pages so no prob!
B.
14 years ago
I have a page with two forms,
The problem is when I press the bottom forms submit button, the top form is submitted but to the action in the bottom form.
I have a formbean associated with the page and I think this is the cause, no matter what form I submit, it expects to submit an object of the type associated with the page, i.e. the form bean defined in struts.config.
Anyone any ideas?
thanks in advance
14 years ago
Hi,
I used the onchange event instead as follows:

thanks
14 years ago
Hi there
I am trying to dynamically submit a form when something is selected in a dropdown menu.
I see from the Struts API that the html:select tag inherits onselect() from the basehandler() but I cant seem to use it, it tells me that the method is not defined in the DTD.
I am using the "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"
Any help would be appreciated
14 years ago