Srinivas Yell

Greenhorn
+ Follow
since Apr 02, 2012
Merit badge: grant badges
For More
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 Srinivas Yell

Hi All,

I'm a newbie. I have written a restful webservice using JAXB. My application is written using spring mvc.
So when a web service request for a particular resource comes, it first hits the controller which calls a facade class method. Most of the business logic is written in the facade class using service method calls.
In facade, DTOs (generated as per the response XSD) are populated with the required attribute values. And the controller returns the response which is converted to XML.

Now, the problem which i'm facing is -
1) There are some attributes in the XSD which are not present in the DB.
2) If the attributes are set to null, the tag is getting disappeared from the response xml.

I need to display these attributes as empty tags in the response and i cannot change the XSD. I have searched for the same in google but didn't find any solution.

Controller:
------------


Facade:
---------


Note that XSD cannot be changed and the DTOs i use are automatically generated from XSD during application build. The response xml should have empty tags (no schema entries please) for RscDate and RscNum-
<RscDate />
<RscNum />

Could you please let me know how this can be achieved ?

Thanks
Srinivas
10 years ago
Hi All,

There are some filters in my web page. When i select them, they will be appended to the URL as query string name-value pair. For example, when i select the size as small in the page, the URL becomes http://www.myapplication.com/items/?size=small.

What i wanna do is to encode the query string parameter values in the URL. i.e. if some user tries modifying the URL as below:
http://myapplication.com/items/?size=<script>alert('there is a vulnerability!!')</script>, then all the special symbols must in the query string URL must be replaced with their equivalent encoded values. This is mainly to prevent XSS attacks.

How do i do it ?

Thanks,
Srinivas
11 years ago