只需要在button中设置一个属性formaction=“servlet地址”,如果一个form中只需要提交到一个servlet中,就不需要这样做,直接在action中写上servlet地址即可。 <button type="submit" formaction="queryInput">