Solved

how to extract window origin in spring

Posted on 2016-08-12
2
58 Views
Last Modified: 2016-08-14
hi,
i basically want to capture what window.location.origin does in javascript from inside the controller in spring.

thanks
0
Comment
Question by:Rohit Bajaj
2 Comments
 

Author Comment

by:Rohit Bajaj
ID: 41753638
so if url hitting my app is http://domain/sjdjkkrkrkjr/....
i need to get http://domain part only inside my controller or handler
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 41755849
You need to pull a few parts and assemble it, but something like this...

public void myController(HttpServletRequest req) {
    String url = req.getScheme() + "://" + req.getServerName();
}

Open in new window


And if you care about other stuff that could be there, such as port, etc, you can pull more things from the request object.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now