jsp file is not displaying message in browser - spring-boot

body content from jsp file is not displayed in browser, controller displays only the return statement.
I have tried with #RestController annotations also, but didnt work. Also added all the required jar including tomcat-jasper & tomact-embedd jasper, but nothinn help. Could some one help me to solve this issue
WebApplication.java webControllerweb.jsp
application.propertiesbrowser
folder structureAlso tried webController.java under seperate package but that also didnt work

Related

XML Sitemap not working with Google Search Console..?

I have an XML sitemap located at https://store.usbswiper.com/sitemap_index.xml, which as you can see loads just fine.
However, Google Search Console is telling me it can't fetch the sitemap.
When I use this validator it's giving me a successful validation.
I have checked the robots.txt, and it's not blocking anything. It specifices the sitemap URL correctly as well.
Any info on why Google Search Console is giving me this "couldn't fetch" message would be greatly appreciated.
EDIT: When I first ran that validator it gave me this error:
Incorrect http header content-type: "" (expected: "application/xml")
I added a robots.txt and then when I ran it and posted this thread it was validating successfully. I just now tried again and it's failing again with the same message. I don't understand why it's working sometimes and sometimes not. The Search Console hasn't successfully loaded at all no matter what the validator is doing.
Add the full link in console;
for example, add https://example.net/sitemap.xml
rather than just sitemap.xml.

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

Magento - blank lines being added to wsdl file

I am trying to call the API but I keep getting a soap error that can't load the file. I found that the reason is there are about 3 blank lines at the top of the XML file that is returned. I found this by doing wget url.
This use to work just fine, when I debug through the API controller the response or xml looks fine all the way through, I don't see any spaces at all. I have no idea what might be causing this. I don't think there is anything we modified that would do this.
UPDATE:: I have found that it appears to be because of an observer class I made for the controller_action_predispatch event. It appears I have some spaces above the
I'm not completely sure of what I am talking about as far as I've never used the API, but you should try to look at the end of the file which generates your XML for a closing '?>'. If there is this closing PHP marker, remove it and try again you API call...
In Magento, PHP file should never be ended by a closing php marker '?>'.
edit: as said in comments, also look at spaces before the opening tag '<?php'.
First thing need to check is api.php file in root folder, most of api blank space issues will come if any empty lines added in api.php file before starting

Web Service error 'Could not create type' when calling service from Ajax

I've downloaded the Ajax Control toolkit
When I create a website from the Ajax control Toolkit template, I can create a web service in a single file (asmx) and hook this up to different Ajax controls provided in the toolkit.
However if I add the Toolkit to an existing ASP.Net 2.0 appliction web project I cannot create web services in a single asmx file. If I create a web service VS always creates a code behind file as well. As a result of this calls to the web service (or loading the service directly in the browser) generate the following error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'AddAjaxToApplication.List'.
Source Error:
Line 1: <%# WebService Language="C#" CodeBehind="List.asmx.cs" Class="AddAjaxToApplication.List" %>
Does anyone know how to resolve this?
Thanks,
Tim
I fixed this in the end.
In VS 2005 I just needed to right click on the web service and select "View Markup". I just changed the markup to use the correct namespace:
Line 1: <%# WebService Language="C#" CodeBehind="List.asmx.cs" Class="List" %>
I Just removed the project name from the namespace to match the namespace used by List.asmx and this error went away.
In my instance I had renamed the class something different than the .asmx file, so when referencing the file from the .aspx code it would generate this error.
So I had 'AjaxManager.asmx', but had renamed the class to 'AjaxService', and the markup did not match. In my case, leaving the fully qualified namespace did not cause any issue. So if you change the class name (probably not reccomended anyway), make sure to correct the markup as well as shown below:
<%# WebService Language="vb" CodeBehind="AJAXManager.asmx.vb" Class="MyProject.UI.AjaxService" %>
One more Important Things and simple solution that i found out while creating web service . Try to avoid creating code behind file
I was facing same problem while accessing web service in a virtual directory in iis 7 , then i created inline code asmx file and then access it , it was accessible
I solved the problem by moving the code behind file MyService.asmx.cs to the App_Code directory.
I solved this by ensuring that MyService.dll was deployed in the /bin folder below my Web.config.
Check in the Published folder if the path for the specified class files really exist or not, For me the App_Code folder was not present in the published directory so I manually placed the folder there and it is working perfectly :-)
I solved this by giving the full path of the codebehind like this
CodeBehind="~/codebehind.asmx.cs"

Resources