Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waffle with Struts2 and Tomcat #608

Closed
evanshwu opened this issue Mar 22, 2018 · 3 comments
Closed

Waffle with Struts2 and Tomcat #608

evanshwu opened this issue Mar 22, 2018 · 3 comments

Comments

@evanshwu
Copy link

evanshwu commented Mar 22, 2018

My website is based on Tomcat and Struts2, and I found Waffle for a simple "login with windows account" feature.
But I found out that after I used Waffle, some actions will be 'ignored' unexpected.
Here are some detail of my code:

This is my .jsp, which has a form to collect data:

<s:set var="bookVo" value="bookVo" />
<s:form action="bookingordersave.action" method="post" name="orderform" id="orderform">
	<input type="text" name="bookVo.zip_code" id="zip_code" value="<s:property value='#bookVo.zip_code'>" />
	...more inputs...
	<button onClick="save();"/>
</s:form>

and the save() will link to a form submit, which a setter will be performed and go straight into save()

public String save(){
     saveToSQL(bookVo);
}

Notice the setter is outside function save(), so the program should save the form data to bookVo first, then perform save(). However, sometimes the program will skip the setter and straight performing save(), which will end up an exception NullPointer for bookVo, if I try to re-submit a few times, it will go back normal and execute the setter. I'm very confused what has caused this issue and this happens after I implement Waffle. Anyone have a clue what could cause this problem?

@hazendaz
Copy link
Member

hazendaz commented Apr 8, 2018

I'm not sure how an authentication would conflict with application code in the way described. I would suspect there is more in the change you have than simply adding waffle. None of that code has anything to do with waffle. Maby you can try the latest master and see if you get any different behaviour or let me know if you have gotten any further since you first raised this.

@evanshwu
Copy link
Author

After nearly 2 months of monitoring and testing, I found a way to stabilize my tomcat project and still keep the Waffle login to be working.

Basically what I do is separate web projects and the waffle project, which will be something like this:

webapps
│ waffle.war
│ webproj.war

└───waffle

└───webproj

What I do is to make the "Login without password" button to redirect to a jsp page under waffle folder, for example /waffle/WebContent/getUsrData.jsp , which will return some data for our login purpose, and then redirect back to /webproj/WebContent/someLoginPage.jsp to further call my LoginAction.java to do some authentication job.

It could be other issues that made my tomcat projects unstable, but this is so far an easy way I do to make it back to normal.

@hazendaz
Copy link
Member

hazendaz commented Jan 9, 2020

User resolved issue, closing ticket.

@hazendaz hazendaz closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants