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

jazb
  • 5,498
  • 6
  • 37
  • 44
vedant
  • 3
  • 2
  • If your file is a jsp file, you could get the base url directly from the request object (https://stackoverflow.com/questions/6271075/how-to-get-the-base-url-from-jsp-request-object) – second Aug 01 '19 at 07:21
  • No.. I have made index.html file and using scriptlet tag i want to call that java method. – vedant Aug 01 '19 at 07: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. – second Aug 01 '19 at 07:34
  • However you could to something like this (https://stackoverflow.com/questions/16032899/invoking-java-scriptlet-in-jsp-using-html), but that doesn`t seem to be very intuitive. – second Aug 01 '19 at 07:42

0 Answers0