Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST parameters not recognized #11

Closed
Stefku opened this issue Aug 23, 2016 · 4 comments
Closed

POST parameters not recognized #11

Stefku opened this issue Aug 23, 2016 · 4 comments

Comments

@Stefku
Copy link

Stefku commented Aug 23, 2016

I deployed the console embedded and I face the problem that I cannot send commands (operations in language of jmx).

Debugging shows, that stringParams here https://github.com/lbovet/jminix/blob/master/src/main/java/org/jminix/console/resource/OperationResource.java#L79 has no value.

The params are available though. The console is working right with the following patch

Map<String, String[]> parameterMap = ((ServletCall) ((HttpRequest) ((OperationResource) this).getRequest()).getHttpCall()).getRequest().getParameterMap();
String[] params = parameterMap.get("param");
stringParams = params;

I try to find out if I have a problem with my configuration, but without success. Does anyone has a hint what the problem could be?

Cheers
Stefku

My configuration for spring boot

<dependency>
    <groupId>org.jminix</groupId>
    <artifactId>jminix</artifactId>
    <version>1.2.0</version>
</dependency>
@Configuration
public class JMinixConfig {
    @Bean
    public ServletRegistrationBean jminixServlet() {
        ServletRegistrationBean servletBean = new ServletRegistrationBean();
        servletBean.addUrlMappings("/admin/jminix/*");
        servletBean.setServlet(new org.jminix.console.servlet.MiniConsoleServlet());
        return servletBean;
    }
}
@jiming
Copy link

jiming commented May 5, 2017

@Bean
public FilterRegistrationBean excludeDefaultFilter(HiddenHttpMethodFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean(filter);
    registration.setEnabled(false);
    return registration;
}

add this will work

@mihxil
Copy link

mihxil commented Sep 15, 2017

I have exactly the same problem. Installed it just via web.xml. Posting results in empty stringParams, and server errrors.

@jiming seems to have a solution, but I don't get it. What's the gist of that? I don't have a FilterRegistrationBean.

@Jeka21rus
Copy link

Jeka21rus commented Aug 18, 2020

I have exactly the same problem. Installed it just via web.xml. Posting results in empty stringParams, and server errrors.

@jiming seems to have a solution, but I don't get it. What's the gist of that? I don't have a FilterRegistrationBean.

Had same issue on jetty, it's own HttpServletRequest implementation (org.eclipse.jetty.server.Request) transfers POST form parameters to parameter map:
/** * Extract Parameters from query string and/or form _content. */ public void extractParameters()
There's no workaround except overriding MiniConsoleApplication and OperationResource with your own implementation as I think

imsandli added a commit to imsandli/jminix that referenced this issue Jul 21, 2022
imsandli added a commit to imsandli/jminix that referenced this issue Jul 29, 2022
imsandli added a commit to imsandli/jminix that referenced this issue Jul 29, 2022
lbovet pushed a commit that referenced this issue Aug 24, 2022
@lbovet
Copy link
Owner

lbovet commented Aug 24, 2022

Fixed by #19

@lbovet lbovet closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants