I have configured 404 error to some error page. But thats working when I am giving anything wrong URL which consists a DOT (.), but when I am giving some wrong URL which does not have any any DOT(.) its not being redirected to the 404 error page. Instead its throwing NullPointedException.
I have searched for this problem and found the answer which worked for me.
The reason for the above problem was the filter class used by me that is FilterDispatcher. Which seems to be deprecated. Instead I used the following one which solved the issue.
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
Related
Any one have solution for this issue .
With Sitecore Solution without SXA Adding empty attribute to httpRunTime tag in web.config file >> requestPathInvalidCharacters="", can fix issue special characters in URL and redirect you to "not found page" insted of 400 error page with message "A potentially dangerous Request.Path value was detected from the client()"
URL like : http://abc/* or http://abc/& >> redirect to item not found page and I replaced it with custom error page . So, NO issue with sitecore site without SXA.
I tried same solution with [sitecore SXA] site but not effected, It go to another error page with message >> illegal characters in path, Also I applied this solution https://kb.sitecore.net/articles/059908, But nothing effect, I still have the same error!!
Any solution, I looking for same behavior in SXA site
I fixed it by using URl rewrite in IIS and created redirect rule to 404 page hosted in site core
I'm getting the following error with Omniauth SAML and I don't know how to debug it any further.
Authentication failure! invalid_ticket: OneLogin::RubySaml::ValidationError, 6:0: ERROR: Element '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmationData': Missing child element(s). Expected is ( {http://www.w3.org/2000/09/xmldsig#}KeyInfo ).
I've tried adding skip_receipient_check but that doesn't seem to affect this issue.
Any ideas?
It looks like in this instance, the customers SAML was invalid and the library did the right thing.
I'm working on a web api call that includes parameters with '&'.
I've tried uriEncodingComponent to get the following thinking it was going to fix the issue but I am still running into the same problem. The url I'm trying to reach is here below.
http://localhost:123/api/Apples/GetApples/Red%20%26%20Green/20
I have also tried changing the HTTPRuntime in my application, without any success, to the following:
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="<,>,*,%,:,\,?" />
Any help is greatly appreciated!
The WebAPIConfig had constraints that was not including &. Included modified my regex expression to accept the character.
I am running MVC 5 and have a search API that produces the following link: /SearchedItem.?format=json where SearchedItem. is the user's input into search. This obviously causes a famous 404 due to a dot character. I've looked into all of the following solutions:
Dot character '.' in MVC Web API 2 for request such as api/people/STAFF.45287
Dots in URL causes 404 with ASP.NET mvc and IIS
ApiController returns 404 when ID contains period
However, neither adding a slash (tried both /SearchedItem./?format=json and /SearchedItem.?format=json/) nor RAMMFAR worked.
Looking for any new suggestions.
You have to change your web.config, the trailing dot let's iis think you are accessing an image.
Add the following within the system.webServer / handlers ( web.config)
<add name="ApiURIs-ISAPI-Integrated-4.0"
path="/api/*"
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
Another suggest would be to set RunAllManagedModulesForAllRequests to true, but i wouldn't recommend that. All static assets would be handled through the .net code then :)
I see in your question that you checked related links. But are you sure? Because i have came accross this in the past and above was my solution...
Most suitable way is to encode once you route to url and decode in the respective action you can use HttpUtility to perform encoding and decoding
If you don't want to encode and decode then try adding relaxedUrlToFileSystemMapping config as explained Here
I've developed a site in struts2, but often, there comes many wrong requests. After 20 or 30 hrs, my server is getting stuck. I want to handle this type of error.
There are given some errors displayed in the server:
1)There is no Action mapped for namespace /operators-in-java/operators-in-java/text and action name javascript. - [unknown location]
.........
2)There is no Action mapped for namespace /super-keyword/text and action name javascript. - [unknown location]
3)There is no Action mapped for namespace /operators-in-java/operators-in-java/history-and-features-of-java/text and action name javascript. - [unknown location]
etc.
I've performed global exception handling as given below:
<global-results>
<result name="excepHandler">/handler.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="excepHandler"/>
</global-exception-mappings>
But it doesn't handle, this type of error. Thanx in advance.
Probably the easiest way is to use wild cards. Simply make a action for "*" and have that direct to your error page. All actions with more specific names will override that case so it should be straight forward.
Does your clients get the 404, not found error?
You could configure your web.xml to redirect to an error page when somebody requests an invalid resource.
<error-page>
<error-code>404</error-code>
<location>/notFound.html</location>
</error-page>
But, I would try to fix whatever is causing the incorrect requests, instead of creating a catch all action. Apparently you've configured struts2 to handle every request, I would check on that first.