How to retain data on the view (JSP) if the validation fails in struts - struts

I am using struts 1.3 and my data on the jsp page gets reset if my validation fails.
It displays the error messages coming from the ActionForm from the validate method, but resets my entire jsp. i tried using struts tags instead of html but it is not helping out.
I even tried looking at this https://stackoverflow.com/a/20499877/1771406 but i dint clearly understand what exactly he is trying to say. can anyone one help me by showing some implemented code please.

the reason why my code was not working inspite of seting getters and setters and html strut tags was only due to this silly mistake of mine
<html:text property="abc" value=""/>
when that value attribute was removed it then worked perfectly fine.
correct code:
<html:text property="abc"/>

Related

Xamarin cannot find inherited custom content page

When using views:BasePage.Background or views:BasePage.Resources and I run the project and changed something on XAML, I got an error saying this:
Code behind code of the said xaml:
ViewModel code:
Looking at the said namespace and custom content page that I inherit, I can verify that the class there is existing:
But when changing those two lines with errors to ContentPage, hot reload seems working fine and changes what I see on my emulator. Any solutions? I tried removing the abstract keyword on BasePage class and adding xmlns:views="clr-namespace:SpellingWiz.Templates.Pages.Base;assembly=SpellingWiz" in the said XAML but still got the same error.
I can't say exactly why ContentPage.Background and ContentPage.Resources are the correct syntax for the child element markup of an inheriting page/view, but that syntax always works for me in similar scenarios as yours.

Bootstrap tooltip not showing in ASP.Net MVC application

I've got a rather weird scenario going on here. I am trying to add tooltips to an existing ASP.Net MVC application in which I'm upgrading Bootstrap to 4.6.2. The upgrade was very smooth with no complications; I just want to replace the default display of titles with the nicer looking tooltips, but for some reason they're not appearing. I tried to simplify things by creating a new view to isolate the problem, and still no tooltip. I tried again with completely new solution, and wouldn't you know it, it works! So my question isn't "how do I create tooltips", but "how can I debug what's going on in the failing project?"
Here's what I've discovered so far. I believe you can see everything that's relevant in this screenshot of the nearly-empty view. All the included script files are there in the right order, my script is there, initializing the tooltip, and there are no messages in the console. When I hover over the link, a new <div> element is added to the DOM. In DevTools, I use the arrows to expand the tree, showing everything in the tooltip. The .fade:not(.show) CSS selector is the reason I don't see it. In the working solution, the show class is properly added to the tooltip's <div>.
So, could there be some setting in the existing application preventing the addition of the show class? Is something failing in the tooltip code,causing it to never add the show class without reporting errors? How should I continue debugging this? I tried stepping through the bootstap.js file, but being a JS noob, I'm getting a little lost. The screenshot is from Chrome, but I see the same behavior in Firefox.
This turned out to be one of those embarrassing oversights. My BundleConfig.cs file was still pointing to old Javascript files that were still hanging around after the upgrade. I should have seen it in the version numbers in the <script> tags.

Parsley error placement

I'm using parsley validation now(super new with this validation) since the caldera form updated their plugin. Any ideas how to place the error messages above the field?
My previous implementation of the error messages is above the field and using jquery validation - error placement.
Thank you.
You should be able to obtain what you want with the right errorContainer option:
Specify the existing DOM container where ParsleyUI should put the errors. It is also possible to configure it with a callback function from javascript, see the annotated source.

Aurelia validation on dynamically created form

I was able to get Aurelia-validation working on a dynamically created form when using the compose element, but I've switched to custom elements for better encapsulation and reuse of the custom controls. However, now my validation seems to be half-broken.
https://gist.run/?id=6e97538c3888cae0f6134faed9d67362
Issue 1: The ValidateBindingBehavior is not doing anything. I suspect it's not finding the controller or matching the rules since the property name is not easily visible in the binding (due to dynamic controls).
Issue 2: For some reason validate() on submit actually only shows the first error instead of all of them. That indicates a problem but I don't know what.
Can anyone get the attached GistRun to work properly?

Does Aurelia support iframe tag: sandbox attribute?

I am new to aurelia. This sample code under the html tab works fine in JSbin:
http://jsbin.com/yiqodilaho/edit?html,js,output
But generates an error in seeCode.run (the online editor that we are developing)
https://seecode.run/#-KAbCyh8F6SpHiTVpOfq .I found that its not working as iframe has set of restrictions and so doesnt allow scripts, API's or form submissions. So, I have used "Sandbox" attribute . sandbox="allow-modals allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts" and it working fine. Now, we have migrated the front end of the project to Aurelia and same problem has occured again. This time adding sandbox attribute couldnt make any difference. Can Somehow help me with this issue..? Does Sanbox attribute work in Aurelia?
Are you asking if aurelia's binding system supports <iframe sandbox.bind="tokens">? It does not support this. HTMLIFrameElement.sandbox is a DOMSettableTokenList which needs to be assigned like this: f.sandbox.value = '...' and aurelia is assigning it like this f.sandbox = '...'.
https://gist.run/?id=7dca16fd08dff85cf71f2fef1c439baf
You should be able to use it like this still: <iframe sandbox="allow-pointer-lock" ...
https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement
https://msdn.microsoft.com/en-us/library/hh771918(v=vs.85).aspx