how to redirect to struts action from javascript in struts 2?

前端 未结 3 1349
北海茫月
北海茫月 2021-01-19 10:44

how to redirect to struts action from java script?

if condition in the script got success then i need to invoke one action in the config xml, otherwise no action inv

3条回答
  •  长情又很酷
    2021-01-19 11:40

    try it

    window.location='youractionname'
    

    This will redirect your window into your destination

    If you want to sent your values to other page, then follow this method

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    
    
    
    
    
    
    Insert title here
    
    
      
            
            
        
    
    
    

    What I modified is, changed the function calling from button to form submit. And removed the unwanted things from function

提交回复
热议问题