Customization of Error Message Display in Struts2 - struts2

i am validating user input in my application using Struts2 build in validation framework and its working fine.
I have to show the error message as per the application layout so need to place my inside a predefined block.
but i need to show this block only when there is validation error in my application and i am unable to figure out how i can do this.
One solution is i should override the theme for error but in that case error theme will applicable for whole application and that is not what i need.Is there any way by whihc i can check if contains any error or not?

Problem solved.after looking at free marker template i came up with solution
something like
fieldErrors.keySet().size()

Related

Kentico MVC - PageBuilder Error on external Staging site

Am using Kentico MVC v12 Service Pack.
Have enabled Preview feature and PageBuilder in Application_Start.
When running from localhost, can successfully edit relevant pages using PageBuilder as required.
However, when ran from a staging site, which is a clone of the localhost version, I am getting an error in the Site settings when I try to add a Presentation Url (I am definitely adding in a valid format with the starting "https://" included), which is required for the PageBuilder to be used in the Pages application, where I see this error:
An unexpected error occurred, see event log for more details. Event source: PageEdit, Event code PreviewLinkGeneration
Any assistance would be much appreciated.
Thanks.
Sites error
That error is basically only looking at the string of the URL (almost like a simple validation). Are you sure there is no whitespace before the value you entered in? I can re-create your issue if I type in a space character before the URL.
You can also try clearing the field and saving the form. Then re-enter a value.
If it is still not working, try re-signing all your macros in the system as I have seen the regular expression validation rules have issues if macros aren't working. Which is really what this check is:

customize error message in django-allauth

How can I customizs error message in django-allauth?
I already implement overriding input forms for login
and it does work very well.
but, i want to build new error message when password mismatch.
I'm not 100% on this, but I believe you would have to make a custom form to do that. If you look into the directory: lib/allauth/account/forms.py in your project you should see all of the forms with their default error messages. It's bad practice to edit this file directly so you would have to make a custom form with the error messages you would like.

Why am I getting the message "The specified request cannot be executed from current Application Pool"?

Quite not sure why I see this error.
I navigate to my Login View like so http://test.staging.com/mywebsite/Login
My Login view was just redone using MVC but I have seen this same error message going to an aspx page as well...
If I use http I get the error message The specified request cannot be executed from current Application Pool.
If I use https://test.staging.com/mywebsite/Login, I'm good.
If I don't specify a protocol, test.staging.com/mywebsite/Login, I get the error as well
Is there an error happening under the covers and my custom error page can't be shown like discussed here?
What are some other causes of this error?
That usually means your custom errors are configured to run as a different AppPool.
You can read more at MSDN. (See section "Using Custom Errors from Another Application Pool").
There are two ways to correct this behavior. The first is possibly not one that you are interested in because it would require you to change your current architecture and run both sites in the same application pool (such as share the same worker process memory space). To do this, simply move the /errors virtual directory to run in the same application pool as the site for which it serves the custom error.
The second way is to make use of a registry key provided by IIS 6.0. This registry key makes sure IIS 6.0 does not check the metadata during the execution of the custom error and therefore allowing this to work.
See the article for information on the registry key fix.
It may also mean that you are using something along the lines of Server.Transfer to a page that is in a different AppPool.
It could be because you're using different versions of ASP.NET for one or many apps in the pool.
Make sure all apps in the pool use the same version of ASP (e.g. ASP 2.0.50727)
If you just added a new app, try changing the app momentarily to a different version of ASP, then back to same version. I experienced an issue where the displayed version was correct, but under the hood, a different version was used!
Check your event log, under Application, to get more details about the error.
The message would be caused by your page server-side redirecting to a page served by another application pool. Such as for example, in your link, the error page.
I know this is an old thread, but I stumbled upon it and found a different solution. Here's what worked for me: Make sure your application handles .asmx files correctly
From IIS:
Right Click on your project > Properties > Configuration
If necessary, add the .asmx file extension that maps to the aspnet_isapi.dll
Limit to: "GET,HEAD,POST,DEBUG" and restart.
Because I can't comment on vcsjones's answer, I'll add it down here. The DWORD value IgnoreAppPoolForCustomErrors needs to be set under HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ Parameters vs HKLM\SYSTEM\CurrentControlSet\Services\W3SVC referenced in that technet article. Set it to 1 and do an iisreset and you're good to go.
Source Blog Post
In my particular case, I received this error while trying to serve a content (non ASP.NET) website while it was an Application. Right-Clicking the virtual folder and removing the application fixed it for me.
In my case the application used the application pool that didn't exist. I have no idea how it's happened.

Delphi 6/JEDI-JVCL - Not getting custom message form with detailed stack dump anymore

I am using Delphi 6 along with the JEDI-JVCL 3.x. My project settings include creating the JDBG files and inserting them into the executable. Yet somewhere along the line I did something that defeated the appearance of the custom Exception handling form that shows the complete detailed stack dump with other information, and now I just get the standard Exception dialog box with just the singular Exception info. Can anyone tell me most likely what I did that is interfering with the appearance of the custom Exception dialog box?
-- roschler
It looks like you have deleted Jcl Exception dialog from the project. Or it just initializes later then exception occurs.

Debugging Django Admin Template Resolution

Can someone point me to the code or a way that I can say print to screen which admin template is being used?
It happens many a time when I am replacing a admin template for an model that I add the template and hit the page and bham... still the same template.
Usually its a case issue or something like that... but it takes me a while if I get stumped to realise what my issue is.
Can anyone suggest an approach, be it put print statements in django code to show which template is getting resolved?
Regards
Mark
Use the django-debug-toolbar, it has a tab that shows all the template_s_ (plural) that are used.
If you run Django's development server from the command line, you can definitely just use print statements to find out which template is being used. You can also use the FireBug plugin for Firefox to figure out what the server is sending back to you.

Resources