Calling a java method in jsp

前端 未结 5 468
刺人心
刺人心 2020-11-28 10:50

I have a java class which performs some operations on files. Since the java code is huge I don\'t want to write this code in jsp. I want to call the methods in jsp whenever

5条回答
  •  半阙折子戏
    2020-11-28 11:06

    Actually, jsp is not the right place to 'performs some operations on files'. Did you hear about MVC pattern?

    If you still interested in calling java method from jsp you can do it, for example:
    1. <% MyUtils.performOperation("delete") %> (scriptlet)
    2. (custom tag)

    Anyway I recomend you to google about scriptlets, jsp custom tags and MVC pattern.
    Best Regards, Gedevan

提交回复
热议问题