[
http://www.stripesframework.org/jira/browse/STS-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11374#action_11374
]
J G commented on STS-555:
-------------------------
Thanks Scott and Kai,
I have followed Kai's idea, overriding getSourcePageResolution and
setSourcePageResolution in my own ActionBeanContext. And in my ActionBean I
have overriden setContext and getContext. It seems ok when I tried to debug.
But the errors are not showing up in the browser. I am wondering if this got to
do with Ajax updating the UI or a browser problem perhaps..?
I even tried to debug the normal flow that does not use Ajax .. for example
coming from a click of a submit button implemented in Stripes and having known
errors in the form. The sequence of events/flows is the same with the Ajax way
of submitting.
Then for Scott's comment, I have done that one like overriding
getSourcePage and having a catch Exception just to catch CryptoUtil's exception
and just returning the un-encrypted source page if it have thrown an exception.
But still the same thing happens.
I wonder if anyone have experienced doing Ajax together with Stripes and if
they have resolved a similar problem that I am encountering.
Thanks,
J G
> _sourcePage passed request parameter via Javascript is having some exception
> on server side validation during getSourcePage
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: STS-555
> URL: http://www.stripesframework.org/jira/browse/STS-555
> Project: Stripes
> Issue Type: Improvement
> Components: Validation
> Environment: Tomcat 6.0.16,
> jdk1.6.0_05,
> Stripes 1.5b1.
> Eclipse 3.3.2.
> Windows XP.
> Internet Explorer 6.0
> Reporter: J G
> Attachments: CryptoUtil.java.patch
>
>
> Hi,
> Currently having an error during validation with errors and calling the
> getContext().getSourcePageResolution() in an ActionBean.. The exception
> trace..
> Bad Base64 input character at 0: 47(decimal)
> 15:14:30,117 DEBUG ExecutionContext:150 - Transitioning to lifecycle stage
> RequestComplete
> 15:14:30,117 WARN DefaultExceptionHandler:39 - Unhandled exception caught by
> the Stripes default exception handler.
> java.lang.IllegalArgumentException: Null input buffer
> at javax.crypto.Cipher.doFinal(DashoA13*..)
> at net.sourceforge.stripes.util.CryptoUtil.decrypt(CryptoUtil.java:188)
> at
> net.sourceforge.stripes.action.ActionBeanContext.getSourcePage(ActionBeanContext.java:249)
> at
> net.sourceforge.stripes.action.ActionBeanContext.getSourcePageResolution(ActionBeanContext.java:226)
> ....
> ...
> ...
> This only happens after a first load of my page. I have an href that have an
> image that has an onclick that triggers a javascript. Then in my javascript
> function I have Ajax.Updater method
> var params = 'initVar&id=' + nId
> + '&_sourcePage=\/bugMaintenance.jsp';
> new Ajax.Updater( "",
> "${pageContext.request.contextPath}/ctrlr/BugMaint.action",
> { method: 'post',
> postBody: params,
> onSuccess: successAddFunc,
> onFailure: errorAddFunc
> });
> I know this might is not the clean way, but do you have any ideas what is
> wrong? Or any suggestion how to do this via Ajax to pass the _sourcePage?
> I tried to debug the source code of stripes. The problem is on the
> ActionBeanContext.getSourcePage(). during the call to
> CryptoUtil.decrypt(sourcePage), since I did not encrypt the _sourcePage which
> I just tweaked and passed as request parameter during an Ajax call, the
> processing throws a Null pointer somewhere inside the decrypting of the
> source page.
> Inside the decrypt(String) method of CryptoUtil, the Base64.decode(input,
> BASE64_OPTIONS) returned null.
> Thanks,
> --jg
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development