I am trying to access the download page https://repo.spring.io/ui/native/release/org/springframework/spring/ , but I ALWAYS get 404 error using VPN and different computers. Since no one seems to have problems accessing the page I am going insane right now. Can you guys access the page and what problem could cause a 404 error on my browser?
Your URL is wrong and that's the reason it responds with 404. In my computer is a 404 also without using any kind of VPN.
Try locating what you want manualy from the base path, although what I think that you need is here
I am doing a Spring web application with many forms. A common practice when a form is successfully saved is saving a success message in session and then redirecting the user to the same or new link where the success message is displayed.
In Spring web, this can be done like the following:
request.getSession().setAttribute("successMessage", "Form saved successfully");
return "redirect:new_link";
I am hoping to make my application stateless but still follow the practice of redirecting and showing a form-save-success message. I am hoping to have an elegant solution. A simple (but I feel not elegant for a few reasons) solution is to attach the message as a string in the returned url similar to the following and let the front-end page to detect and display the message.
return "redirect:new_link?successMessage=Form-saved-successfully";
I think any idea or solution applies to any web applications, regardless of platforms used or programming languages.
Any input is really appreciated.
Thanks and regards!
Use the Post-Redirect-Get pattern
Use Flash Attributes to show Success/Failure messages on subsequent pages.
Assuming you use Spring 3.1 or up, then you can use flash attributes for that purpose. Define a method attribute of the type RedirectAttributes. The javadoc have a sample on how to use them.
Although this doesn't make your application stateless, it removes the direct couling to the session. (In theory you could implement your own FlashMapManager as the default still stores it in the session).
If you want a stateless solution either you need to put the message (or a message code) in the redirect URL or redirect to a specific 'Your-Form-Was-Saved' page which always shows the same message.
I have an application running in Azure (trial account). So far so good, everything has been nice, except for a long deploy times (10-15 minutes).
I've done a deploy recently and got a lot of weird bugs I cannot trace. For example, if I log in and thus a cookie is created (I use FormsAuthentication) all I get from the application is a blank page, as in, absolutely nothing is sent to the browser. The application works fine in the ASP.NET Web Dev Server, IIS Express, even the Azure Emulator!
What could be the issue? Searching the web hasn't been much help, with only a couple of unrelated issues.
I tried logging into the site (if I correctly understood from one if the comments, the url is versulo.com) and I didn't get any blank page with 404 status code.
However, there is another problem I spotted. Your site seems to be implementing caching inappropriately. The main page, the one from which you trigger the login and which is dynamic in nature contains an Expires header set at 5 minutes after the pages first load. That means that each call or redirect to that page within 5 minutes since it was first loaded, will be served from the browser's cache.
Because of that, after I login into your application I am redirected back to the home page which looks like I am not logged in. If I force a F5 refresh on the browser, then the page will indeed show me as logged in.
If instead of a refresh I try to login again (which is what I did in my first trials, since it looked like the login didn't work in the first time), I am getting an error page with the following message:
Sorry, there has been an error on the server.
500
The page looks like an application error page and even if it displays the 500 number, it is actually served with an HTTP 200.
So, while I am not 100% sure if this is also the cause of the problem described by you, you should remove the Expires headers from the dynamic pages your application is serving.
This can be because you're combining Forms Authentication with multiple instances. Are you using multiple instances? If that's the case, could you:
Try to change it to 1 instance. Does this fix the issue?
Try to make the following change to the web.config (configure machineKey): http://msdn.microsoft.com/en-us/library/ff649308.aspx
some partial views are not rendered at all;
Do you mean some pages are working fine, but others are not? It would be better if you can point out a pattern on what’s working and what’s not? For now, please make sure all referenced assemblies (except for default .NET assemblies and Windows Azure runtime) have Copy Local set to true. For example, MVC assemblies are considered as extensions to .NET, so please set Copy Local to true. In addition, you can also try to use Fiddler to monitor the requests to see what’s returned from the server.
Best Regards,
Ming Xu.
Could you provide a link to the application, or perhaps some source code?
When you say 'blank page', what is actually returned, a 404 / 500?
Have you inspected the IIS logs, or added some trace information to your code?
Have you tried accessing the service using it's ip address rather than domain name?
I was wondering how you could mock that a controller is decorated with the [Authorize] attribute in MVC3? I am using a custom membership provider. I would like to test that a controller been decorated with the attribute and you are authorized and what happens when you are not. I'm using Moq. Any good suggestions on this?!
UPDATE:
I'm currently getting an NullreferenceException saying "object reference not set to an instance of an object". It's the same error as previously mentioned in this post NullReferenceException while using Authorize Attribute
This is related to the Authorize attribute. I'm running under iis and not using cassini. Does anyone know if this is somehow related to applicaton pool and user rights. The tests that I have for the authorize attribute wont work until this is fixed.
Maybe there is some other way of testing the Authorize attribute? Big thanks in advance.
UPDATE2
So after some extensive research and debugging help from a colleague I mentioned to fix the problem with the [Authorize] attribute. It appears as though this line in the web.config was missing:
<modules runAllManagedModulesForAllRequests="true">
Strangely enough this did not cause problem for another colleague that was sharing the trunk or in beta environment. It only caused problems for me locally. This might have been related to something in the GAC. Anyhow all works now.
Thanks.
I wrote a blog post about exactly that a couple of months ago:
http://thomasardal.com/unit-testing-attribute-decorations/
Do I need to do anything extra to get Glimpse to cough up details on a request that return the default 404 server error page on Cassini? By default 404 page, I mean the "Server Error in '/' Application" with a message of "The resource cannot be found" (as well as the HTTP 404 description, requested URL, and version info).
This project has some fairly complex routing, so I don't doubt I have something conflicting with what I am trying to do. I just want Glimpse to provide whatever details it can to point me in the right direction for fixing the problem.
I loaded up Glimpse via NuGet on an MVC3 project I am running through Visual Studio 2010's built-in hosting system (Cassini), and all works fine on previously working action methods and their resulting views. Since then, I added another action method that is proving difficult to hit via the default URL structure (e.g., /controller/action?someparam=x). Since I thought the Glimpse route data would be quite handy for determining what is going wrong here, I went looking for the eyeball in the corder of the default 404 page. Glimpse doesn't appear to be "attached" to this result.
UPDATE: Also doesn't work with RouteDebugger. Whatever I have wrong, it is high enough in the pipeline that nothing seems to be able to pin itself into the response.
UPDATE: The request URL wasn't working because I forgot I had this action set with [HttpPost]. That completely explains the 404, but not how to get any route information from the various utilities on the response sent back.
As far as glimpse goes, one of the reason it wasn't showing in the first place is that we only enable Glimpse on 200 Success results. Hence why the eyeball wouldn't showup for a 404.
Why its not showing up now... have you gone to the /Glimpse/Config page and turned glimpse on? Glimpse isn't enabled by default, so you have to explicitly turn it on.
Let me know how it goes.