0

I have one index.cshtml file wherein it has code that references to some method of a class in other file and stored in windows.baseurl . Now I want to write the index.cshtml as index.html file. So basically I have 2 problems 1) What is windows.baseurl in ASP.NET in index.cshtml 2) if I want to migrate that index.cshtml file to index.html file, then how do i reference that baseurl() method in html file using JSP.

the code in index.cshtml file is

window.baseurl = "@Html.GetBaseUrl()"

the code which I wrote in java, the method is

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { NewMethod.getBaseUrl(request); }

so how do i call the above method using JSP in index.html file

4
  • If your file is a jsp file, you could get the base url directly from the request object (stackoverflow.com/questions/6271075/…) Commented Aug 1, 2019 at 7:21
  • No.. I have made index.html file and using scriptlet tag i want to call that java method. Commented Aug 1, 2019 at 7:25
  • I dont think thats possible. jsp is executed on the server-side while scriplet tags contain code that is executed on the client side. Commented Aug 1, 2019 at 7:34
  • However you could to something like this (stackoverflow.com/questions/16032899/…), but that doesn`t seem to be very intuitive. Commented Aug 1, 2019 at 7:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.