How load servlet on index.jsp

前端 未结 4 1558
广开言路
广开言路 2020-12-29 15:27

Is there is any way to call a servlet on index.jsp? My welcome file is index.jsp. I need to populate dropdown list values by a servlet when i

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 16:10

    There are multiple ways to achieve this depending on what frameworks you are using.

    In simple terms you can either call the servlet first and set up the data into the form and then redirect to your JSP.

    Or

    If you are familiar with Ajax you can make an ajax call from your jsp to fetch the data for you

    If you can tell me the frame work you are using for you project I can provide you an example

提交回复
热议问题