Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Raaja Gotluru

Ranch Hand
+ Follow
since Mar 02, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raaja Gotluru

Hi Stephan,

Thanks for giving the reply. But that link didnt help as that is for nodejs. I tried basing on the link but it didn't worked as there is no set method for socket to set origin.
I am trying socket io to connect to my server running the servlet but I am getting CORS error. I tried to give localhost, 127.0.0.1, system ip. But still I am not able to figure out.

Am I missing something.

In order to run the following code do I need to run anything else or add something. My servlet is running on 8080 port



How to resolve this. I am generating the above html using servlet where I have already set response.setHeader("Access-Control-Allow-rigin","http://127.0.0.1:8080");

it is the same servlet which generates the html and process the request from html script.
I am able to access the service from project A in project B after adding the following line



along with



ref: http://stackoverflow.com/questions/8391944/getting-spring-error-bean-named-x-must-be-of-type-y-but-was-actually-of-ty

Thanks for the help Jeanne and Javesh.
5 years ago
Thanks for the reply Jeanne and Javesh.

Project A is having java configuration and project B is xml configured. As suggested by Jeanne I used <context:component-scan base-package="com.coderanch.myPackage" /> and imported project A's spring-context xml. But I dont have any idea what is happening when I run the test it is throwing following error as it is not able to find the bean.



project A config file



And individually project A is running

Test class

5 years ago
I have a situation where I need to import beans annotated with @Bean from one project to another project. Is there any way to achieve this.

For example I have project A and Project B, I want to use a bean of project A in project B so that I don't want to write the same code again. All these DAO beans are annotated with @Bean
5 years ago
I am trying to display the files stored in server using jsp. I used the code below to display. But for pdf it is asking to download (No option for open). For XLS, XLSX, DOCX, PPT and PPTX it is showing zip file to download. For type doc it is showing junk data. What I wrong I am not getting idea. Can anyone guide me in this.


6 years ago
JSP
Thanks for the reply Ulf Dittmer. Problem is I cannot use jQuey. At the same time I cannot use commons-fileupload as my request is getting read in the base class. So once the control comes to the required class I am not able to get the data from request. So when I use

items = upload.parseRequest(request);

I am getting null list.

Any way I changed the design solved that by generating dynamically one file input element for each file to upload.
6 years ago
JSP
Hi,

In my jsp, I have a table with some file paths with this I have to get the file and send it to server. I am able to read the file name, size and file as binary using files of javascript. But after that I need to send those files by storing in a byte array to servlet which I am not able to that. Is there any way I can send that. My requirement is I need to upload those files to server side.
6 years ago
JSP
I have a situation where I need to update a record in parent table and insert records in child table using Hibernate at a time. How can I achieve this. Can any one guide me in this regard.
Thanks for the response and guidance tsuji. I will try this.
Thanks for the reply tsuji. But my situation is I cannot pass id for both the XMLs as the first one is to create and the second one is for update. For create, I should not allow the tag. If by mistake if some one gives this tag it should show error. For update that is in second xml only it should allow.
I need to write an common XSD for two XMLs which is having a difference of one element.

like



the other one



How to validate the above two XMLs with a single XSD.
Solved these by disabling backspace button and removed the menu bar from the browser



and

6 years ago
JSP
I am working in a web project where I am getting two issues in navigation.

1. In first page after saving the data it will go to second page and from there if I click back navigation button in the browser the first page will appear and user can modify the data he already saved and click again to save as this page is for both edit and save I am not getting idea how to solve this.

for this I googled and tried like this but this didnt worked in chrome.



2. In IE, in another page, if I click on back navigation button on the browser I will get page not found error. If I refresh or F5 I will get that page back but the data will be not there. This data we receive from db and request.

Please help me in solving this.
6 years ago
JSP